Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:TeenQuotes/website into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Augusti committed Nov 27, 2015
2 parents c486cae + 2453af0 commit 617c582
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions app/TeenQuotes/AdminPanel/AdminPanelServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace TeenQuotes\AdminPanel;

use Illuminate\Support\ServiceProvider;
use TeenQuotes\AdminPanel\Helpers\Moderation;

class AdminPanelServiceProvider extends ServiceProvider
{
Expand All @@ -33,13 +34,15 @@ public function register()

private function registerRoutes()
{
$this->app['router']->pattern('decision', 'approve|unapprove|alert');
$this->app['router']->pattern('decision', Moderation::presentAvailableTypes());

$this->app['router']->group($this->getRouteGroupParams(), function () {
$this->app['router']->get('/', ['uses' => $this->getController().'@index', 'as' => 'admin.quotes.index']);
$this->app['router']->get('edit/{quote_id}', ['uses' => $this->getController().'@edit', 'as' => 'admin.quotes.edit']);
$this->app['router']->put('update/{quote_id}', ['uses' => $this->getController().'@update', 'as' => 'admin.quotes.update']);
$this->app['router']->post('moderate/{quote_id}/{decision}', ['uses' => $this->getController().'@postModerate', 'as' => 'admin.quotes.moderate']);
$controller = $this->getController();

$this->app['router']->group($this->getRouteGroupParams(), function () use ($controller) {
$this->app['router']->get('/', ['uses' => $controller.'@index', 'as' => 'admin.quotes.index']);
$this->app['router']->get('edit/{quote_id}', ['uses' => $controller.'@edit', 'as' => 'admin.quotes.edit']);
$this->app['router']->put('update/{quote_id}', ['uses' => $controller.'@update', 'as' => 'admin.quotes.update']);
$this->app['router']->post('moderate/{quote_id}/{decision}', ['uses' => $controller.'@postModerate', 'as' => 'admin.quotes.moderate']);
});
}

Expand Down
2 changes: 1 addition & 1 deletion app/TeenQuotes/AdminPanel/Helpers/Moderation.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static function getAvailableTypes()
*
* @return string
*/
private function presentAvailableTypes()
public static function presentAvailableTypes()
{
return implode('|', self::getAvailableTypes());
}
Expand Down

0 comments on commit 617c582

Please sign in to comment.