Skip to content

Commit

Permalink
Changed the view facades to be under the name Wardrobe.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericlbarnes committed Jun 16, 2013
1 parent eb46080 commit 81d0908
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/Wardrobe/BackendServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public function register()

$this->app->singleton('Wardrobe\Repositories\UserRepositoryInterface', 'Wardrobe\Repositories\DbUserRepository');

$this->app->bind('Entries', function()
$this->app->bind('Wardrobe', function()
{
return new \Wardrobe\Facades\Entries(new Repositories\DbPostRepository);
return new \Wardrobe\Facades\Wardrobe(new Repositories\DbPostRepository);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use Wardrobe\Repositories\PostRepositoryInterface;

class Entries {
class Wardrobe {

/**
* The post repository implementation.
Expand All @@ -24,11 +24,22 @@ public function __construct(PostRepositoryInterface $posts)

/**
* Fetch Posts
*
* @param array $params
* @return Posts
*/
public function fetch($params = array())
{
$per_page = isset($params['per_page']) ? $params['per_page'] : "30";
$per_page = isset($params['per_page']) ? $params['per_page'] : Config::get('wardrobe.per_page');

return $this->posts->active($per_page);
}

return $this->posts->active()->paginate($per_page);
/**
* Fetch all tags
*/
public function tags()
{
return $this->posts->allTags();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

use Illuminate\Support\Facades\Facade;

class EntriesFacade extends Facade {
class WardrobeFacade extends Facade {

/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor() { return 'Entries'; }
protected static function getFacadeAccessor() { return 'Wardrobe'; }

}
2 changes: 1 addition & 1 deletion app/config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@

'aliases' => array(

'Entries' => 'Wardrobe\Facades\EntriesFacade',
'Entries' => 'Wardrobe\Facades\WardrobeFacade',

'App' => 'Illuminate\Support\Facades\App',
'Artisan' => 'Illuminate\Support\Facades\Artisan',
Expand Down

0 comments on commit 81d0908

Please sign in to comment.