<?php Route::get('repo', ['uses' => 'GithubController@index', 'as' => 'index']); Route::get('/finder', ['uses' => 'GithubController@finder', 'as' => 'finder']); Route::get('/edit', ['uses' => 'GithubController@edit', 'as' => 'edit_file']); Route::post('/update', ['uses' => 'GithubController@update', 'as' => 'update_file']); Route::get('/commits', ['uses' => 'GithubController@commits', 'as' => 'commits']); Route::get('auth/github', function () { return SocialAuth::authorize('github'); }); Route::get('auth/github/callback', function () { // Automatically log in existing users // or create a new user if necessary. SocialAuth::login('github', function ($user, $details) { }); // Current user is now available via Auth facade $user = Auth::user(); return Redirect::to('repo'); }); Route::controllers(['auth' => 'Auth\\AuthController', 'password' => 'Auth\\PasswordController']); Route::get('/', function () { return view('welcome'); }); Route::get('home', function () { return view('loggedin'); });
return redirect("http://www.anrdoezrs.net/click-7952756-10440471-1313778077000"); } }); Route::get('/out/{slug}', function ($slug) { $resource = App\Resource::findBySlug($slug); if ($resource->afflink) { $url = $resource->afflink . "?startupwrench"; } else { $url = $resource->domain . "?startupwrench"; } $resource->clicks += 1; $resource->save(); return redirect($url); }); Route::get('facebook/authorize', function () { return SocialAuth::authorize('facebook'); }); Route::get('facebook/login', function () { try { SocialAuth::login('facebook', function ($user, $details) { $user->email = $details->email; $user->save(); }); } catch (ApplicationRejectedException $e) { // User rejected application } catch (InvalidAuthorizationCodeException $e) { // Authorization was attempted with invalid // code,likely forgery attempt } // Current user is now available via Auth facade $user = Auth::user();
return "DONE "; }); Route::GET('github/authorize', function () { return SocialAuth::authorize('github'); }); Route::GET('github/login', function () { SocialAuth::login('github', function ($user, $userdetails) { var_dump($userdetails); $user->email = $userdetails->email; $user->id = $userdetails->id; $user->save(); }); return "DONE "; }); Route::GET('google/authorize', function () { return SocialAuth::authorize('google'); }); Route::GET('google/login', function () { SocialAuth::login('google', function ($user, $userdetails) { dd($userdetails); }); return "DONE "; }); // API Version 1.0 Route::group(['prefix' => 'api/v1', 'namespace' => 'Api\\V1'], function () { /*Getting json bookings data*/ Route::GET('/bookings', 'ApiController@bookingsApi'); /*Getting json cars listing */ Route::GET('/cars', 'ApiController@carsApi'); /*Getting the json price listing*/ Route::GET('/price', 'ApiController@priceApi');
<?php use SocialNorm\Exceptions\ApplicationRejectedException; use SocialNorm\Exceptions\InvalidAuthorizationCodeException; /* |-------------------------------------------------------------------------- | 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 () { return view('welcome'); }); Route::get('{provider}/authorize', function ($provider) { return SocialAuth::authorize($provider); }); Route::get('{provider}/login', function ($provider) { SocialAuth::login($provider); return "done"; });