<?php /* |-------------------------------------------------------------------------- | Application Routes |-------------------------------------------------------------------------- | | Here is where you can register all of the routes for an application. | It's a breeze. Simply tell Laravel the URIs it should respond to | and give it the controller to call when that URI is requested. | */ Route::get('/', function () { $posts = App\Post::where('active', '1')->orderBy('created_at', 'desc')->paginate(6); return view('frontend.front.index', compact('posts')); }); Route::get('category', 'CategoryController@index'); //login and register with github Route::get('auth/github', 'Auth\\AuthController@redirectToProvider'); Route::get('auth/github/callback', 'Auth\\AuthController@handleProviderCallback'); //login and register with facebook Route::get('auth/facebook', 'Auth\\AuthController@redirectProvider'); Route::get('auth/facebook/callback', 'Auth\\AuthController@ProviderCallback'); //login and register google Route::get('auth/google', 'Auth\\AuthController@redirectGoogleProvider'); Route::get('auth/google/callback', 'Auth\\AuthController@ProviderGoogleCallback'); // login with aplikasi Route::get('login', 'Auth\\AuthController@getLogin'); Route::post('login', 'Auth\\AuthController@postLogin'); Route::get('logout', 'Auth\\AuthController@getLogout'); // registrasi aplikasi
<?php /* |-------------------------------------------------------------------------- | Application Routes |-------------------------------------------------------------------------- | | Here is where you can register all of the routes for an application. | It's a breeze. Simply tell Laravel the URIs it should respond to | and give it the controller to call when that URI is requested. | */ Route::get('/', ['as' => 'home', 'uses' => 'BlogController@index']); Route::bind('slug', function ($slug) { return App\Post::where('slug', $slug)->first(); }); Route::get('blog/{slug}', 'BlogController@show'); Route::post('blog/{slug}', 'BlogController@postComment'); Route::get('auth/login', ['as' => 'login', 'uses' => 'Auth\\AuthController@getLogin']); Route::post('auth/login', 'Auth\\AuthController@postLogin'); // Logging users out Route::get('auth/logout', 'Auth\\AuthController@getLogout'); Route::get('auth/register', ['as' => 'register', 'uses' => 'Auth\\AuthController@getRegister']); Route::post('auth/register', 'Auth\\AuthController@postRegister'); Route::get('dashboard', 'DashboardController@index'); // Add new post Route::get('dashboard/add/post', 'DashboardController@getNewPost'); Route::post('dashboard/add/post', 'DashboardController@postNewPost'); /** * Routes for static pages /about and /contact */