Skip to content

Instantly share code, notes, and snippets.

@vinicius73
Last active August 29, 2015 14:20
Show Gist options
  • Save vinicius73/627306911dd12376fa65 to your computer and use it in GitHub Desktop.
Save vinicius73/627306911dd12376fa65 to your computer and use it in GitHub Desktop.
Como organizar: Painel e Front no Laravel 5 (Rotas)
<?php
// Painel (ADMIN)
Route::group(['prefix' => 'painel', 'namespace' => 'Painel'], function()
{
Route::get('posts', ['as' => 'painel.posts.index', 'uses' => 'PostsCtrl@index']); // App/Http/Controllers/Painel/Posts.php
Route::get('posts/{id}', ['as' => 'painel.posts.show', 'uses' => 'PostsCtrl@show']);
});
// Front (Site)
Route::group(['namespace' => 'Front'], function()
{
Route::get('posts', ['as' => 'posts.index', 'uses' => 'PostsCtrl@index']); // App/Http/Controllers/Front/Posts.php
Route::get('posts/{id}', ['as' => 'posts.show', 'uses' => 'PostsCtrl@show']);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment