Ejemplo n.º 1
0
<?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 () {
    return view('welcome');
});
Route::controllers(['auth' => 'Auth\\AuthController', 'password' => 'Auth\\PasswordController']);
$resources = App\Resource::all();
foreach ($resources as $resource) {
    $new_route = Route::match([$resource->verb], $resource->pattern, ["as" => $resource->name, "uses" => $resource->target]);
    if ($resource->secure) {
        $new_route->middleware(['auth']);
    }
}
Ejemplo n.º 2
0
});
Route::controller('users', 'UserController');
// Route::get('/topic/{slug}', 'TopicController@getTopic');
Route::get('resource/{slug}', 'ResourceController@getIndex');
Route::get('resources/{slug}', 'ResourceController@getIndex');
Route::controller('resource', 'ResourceController');
Route::get('/go/{slug}', function ($slug) {
    switch ($slug) {
        case "inmotion":
            return redirect("https://secure1.inmotionhosting.com/cgi-bin/gby/clickthru.cgi?id=patrickcurl&page=3");
        case "resume-rabbit":
            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) {