Arkadaşlar merhaba. Laravel ile yazılmış açı kaynak kodlu projeleri incelerken "Lavalite" adında bir projeye denk geldim. ( bknz:
http://www.lavalite.org/) Kodları incelediğim de hiç bir şey anlamadım. Evet laravel de yeniyim ama benim yazdığım kodlarla alakası yok.Ama yazılan kodlar sadelik açısından çok hoşuma gitti. Bu konuda iyi olan birisi açıklama yapabilirse sevinirim.
Mesela routes.php dosyası bu şekilde.
routes.php
Route::group(['middleware' => 'web'], function () {
// Home page for the website.
Route::get(trans_setlocale() . '/', 'PublicWebController@home');
Route::get(trans_setlocale() . '/home', 'UserWebController@home');
Route::get(trans_setlocale() . '/client', 'ClientWebController@home');
Route::get(trans_setlocale() . '/client/profile', 'ClientWebController@getProfile');
Route::post(trans_setlocale() . '/client/profile', 'ClientWebController@postProfile');
Route::get(trans_setlocale() . '/client/password', 'ClientWebController@getPassword');
Route::post(trans_setlocale() . '/client/password', 'ClientWebController@postPassword');
Route::auth();
});
Özelikle bu Controller daki kurucu methodu hiç anlamadım(?)
UserWebController.php
class UserWebController extends Controller
{
use UserManager;
/**
* The authentication guard that should be used.
*
* @var string
*/
protected $guard = 'web';
/**
* The home page route of user.
*
* @var string
*/
protected $home = 'home';
public function __construct()
{
$this->middleware('web');
$this->middleware('auth:web');
$this->middleware('auth.active:web');
$this->setupTheme(config('theme.themes.user.theme'), config('theme.themes.user.layout'));
parent::__construct();
}
}