コード例 #1
0
ファイル: BaseController.php プロジェクト: nix222/crm-system
 public function __construct()
 {
     $this->userdata = $this->checkUserdata();
     // apply authorization filter
     $this->beforeFilter(function () {
         if (!$this->userdata && Request::segment(1) !== 'login') {
             return Redirect::to('/login');
         }
     });
     // templates for app errors
     App::missing(function ($exception) {
         return Response::view('errors.404_cms', array(), 404);
     });
     App::error(function (Exception $exception, $code) {
         Log::error($exception);
         if ($code == 403) {
             return Response::view('/errors/error_403', array(), 403);
         }
     });
     // shared assets
     Orchestra\Asset::add("bootstrap-css", "assets/css/bootstrap.min.css");
     Orchestra\Asset::add("bootstrap-theme", "assets/css/bootstrap-theme.min.css");
     Orchestra\Asset::add("font-awesome", "assets/css/font-awesome.min.css");
     Orchestra\Asset::add("cms-css", "assets/css/cms.css");
     Orchestra\Asset::add("jquery", "assets/js/jquery.js");
     Orchestra\Asset::add("bootstrap-js", "assets/js/bootstrap.min.js");
     Orchestra\Asset::add("handlers-js", "assets/js/handlers.js");
     // shared views
     View::share("active_menu_id", 1);
     View::share("userdata", $this->userdata);
     // configuration
     Config::set("view.pagination", "common/pagination");
 }
コード例 #2
0
|
| The "down" Artisan command gives you the ability to put an application
| into maintenance mode. Here, you will define what is displayed back
| to the user if maintenance mode is in effect for the application.
|
*/
App::down(function () {
    return Response::make("Be right back!", 503);
});
/*
|--------------------------------------------------------------------------
| Require The Filters File
|--------------------------------------------------------------------------
|
| Next we will load the filters file for the application. This gives us
| a nice separate location to store our route and application filter
| definitions instead of putting them all in the main routes file.
|
*/
require app_path() . '/filters.php';
/**
 * Register not found function to handle 404.
 */
App::missing(function () {
    Cache::flush();
    $config = Theme::first();
    $themes = Config::get('themes');
    $admin_theme = $themes[$config->admin_theme];
    View::share('admin_theme', $admin_theme);
    return Response::view('admin.404', [], 404);
});
コード例 #3
0
ファイル: routes.php プロジェクト: irontroter/website
/**
 * Define Current Docs Version Constant
 */
if (!defined('DOCS_VERSION')) {
    $version = Cookie::get('docs_version', '4.2');
    if (Input::query('version') and in_array(Input::query('version'), array('4.0', '4.1', '4.2', 'master'))) {
        $version = Input::query('version');
    }
    define('DOCS_VERSION', $version);
}
/**
 * Catch A 404 On Docs...
 */
App::missing(function ($e) {
    if (Request::is('docs/*')) {
        return Redirect::to('docs');
    }
});
/**
 * Main Route...
 */
Route::get('/', function () {
    return View::make('index');
});
/**
 * Documentation Routes...
 */
Route::get('docs/dev', function () {
    Cookie::queue('docs_version', 'master', 525600);
    return Redirect::back();
});
コード例 #4
0
ファイル: global.php プロジェクト: kleitz/bjga-scheduler
$logFile = 'log-' . php_sapi_name() . '.txt';
Log::useDailyFiles(storage_path() . '/logs/' . $logFile);
/*
|--------------------------------------------------------------------------
| Application Error Handler
|--------------------------------------------------------------------------
|
| Here you may handle any errors that occur in your application, including
| logging them or displaying custom views for specific errors. You may
| even register several error handlers to handle different types of
| exceptions. If nothing is returned, the default error view is
| shown, which includes a detailed stack trace during debug.
|
*/
App::missing(function ($exception) {
    return Response::view('errors.missing', [], 404);
});
App::error(function (Exception $exception, $code) {
    Log::error($exception);
    if (App::environment() == 'production' and $code != 404) {
        $emailData = array('user' => "the Scheduler", 'content' => nl2br(Request::instance()->fullUrl() . "\r\n\r\n" . $exception->getMessage() . "\r\n\r\n" . $exception->getFile() . ":" . $exception->getLine() . "\r\n\r\n" . $exception->getTraceAsString()));
        Mail::send('emails.reportProblem', $emailData, function ($msg) {
            $msg->to('*****@*****.**')->subject("[Brian Jacobs Golf] Exception Thrown!");
            if (Auth::check()) {
                $msg->from(Auth::user()->email, Auth::user()->name);
            }
        });
        return View::make('pages.admin.error')->withError("Uh-oh! It looks like you stumbled across an error. We apologize for the issue. The problem has been automatically reported to Brian Jacobs Golf. If you continue to have trouble, email admin@brianjacobsgolf.com for more help.");
    }
});
App::error(function (Scheduler\Exceptions\FormValidationException $exception, $code) {
コード例 #5
0
ファイル: filters.php プロジェクト: andrims21/eBri
        unset($user);
    } catch (\PDOException $e) {
        if (!in_array($request->path(), array('install', 'install/db', 'install/api', 'install/user', 'install/complete'))) {
            return Redirect::to('/install', 302);
        }
    }
});
App::after(function ($request, $response) {
    if (get_class($response) != 'Symfony\\Component\\HttpFoundation\\BinaryFileResponse') {
        $response->header('Cache-Control', 'no-cache, must-revalidate');
        $response->header('P3P', 'CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');
    }
});
App::missing(function ($exception) {
    Log::error('URL : ' . URL::current());
    $error = new Andriynto\Ebri\Controllers\Error();
    return $error->_404();
});
/*
|--------------------------------------------------------------------------
| Auth Filters
|--------------------------------------------------------------------------
|
| The following filters are used to verify user logged in.
|
*/
Route::filter('ebri.loggedin', function () {
    $api = App::make('ebri.api');
    if (!$api->logsUserIn()) {
        return $api->getApiServer()->resourceJson(array('message' => 'User logged out or not activated.'), 405);
    }
コード例 #6
0
*/
App::error(function (Exception $exception, $code) {
    Log::error($exception);
});
/*
|--------------------------------------------------------------------------
| Maintenance Mode Handler
|--------------------------------------------------------------------------
|
| The "down" Artisan command gives you the ability to put an application
| into maintenance mode. Here, you will define what is displayed back
| to the user if maintenance mode is in effect for the application.
|
*/
App::down(function () {
    return Response::make("Be right back!", 503);
});
App::missing(function () {
    return Response::make("This is not a valid URL for this REST service.", 404);
});
/*
|--------------------------------------------------------------------------
| Require The Filters File
|--------------------------------------------------------------------------
|
| Next we will load the filters file for the application. This gives us
| a nice separate location to store our route and application filter
| definitions instead of putting them all in the main routes file.
|
*/
require app_path() . '/filters.php';
コード例 #7
0
ファイル: global.php プロジェクト: renlok/viper
| Application Error Handler
|--------------------------------------------------------------------------
|
| Here you may handle any errors that occur in your application, including
| logging them or displaying custom views for specific errors. You may
| even register several error handlers to handle different types of
| exceptions. If nothing is returned, the default error view is
| shown, which includes a detailed stack trace during debug.
|
*/
App::error(function (Exception $exception, $code) {
    Log::error($exception);
    return BaseController::error(Config::get('response.unknown.code'), Config::get('response.unknown.http'), 'Unknown error');
});
App::missing(function (Exception $exception) {
    return BaseController::error(Config::get('response.method.code'), Config::get('response.method.http'), 'Method not found');
});
App::error(function (Viper\Exception $exception) {
    return BaseController::error($exception->getCode(), $exception->getStatusCode(), $exception->getMessage());
});
/*
|--------------------------------------------------------------------------
| Maintenance Mode Handler
|--------------------------------------------------------------------------
|
| The "down" Artisan command gives you the ability to put an application
| into maintenance mode. Here, you will define what is displayed back
| to the user if maintenance mode is in effect for the application.
|
*/
App::down(function () {
コード例 #8
0
ファイル: routes.php プロジェクト: shaikhatik0786/Masteranime
        return $list;
    }
    return '<li>' . link_to($routes[0]['route'], $routes[0]['text']) . '</li>';
});
/*
|--------------------------------------------------------------------------
| 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 Closure to execute when that URI is requested.
|
*/
App::missing(function ($exception) {
    return View::make('child.404');
});
Route::get('/', function () {
    return View::make('home');
});
Route::get('/donate', function () {
    return View::make('donate');
});
Route::get('/animehd', function () {
    return View::make('animehd');
});
Route::get('/sitemap', function () {
    $sitemap = App::make("sitemap");
    $sitemap->add('http://www.masterani.me/', '2014-07-09T20:10:00+02:00', '1.0', 'daily');
    $sitemap->add('http://www.masterani.me/latest', '2014-07-09T12:30:00+02:00', '0.9', 'daily');
    $sitemap->add('http://www.masterani.me/anime', '2014-07-09T12:30:00+02:00', '0.9', 'daily');
コード例 #9
0
ファイル: routes.php プロジェクト: affankhan/projects_enroll
<?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 Closure to execute when that URI is requested.
|
*/
App::missing(function () {
    return Redirect::to('/404');
});
route::get('/404', function () {
    return View::make('error.404');
});
Route::get('/', function () {
    return View::make('index');
});
Route::get('/tcit/student/subscribe', 'HomeController@showForm');
コード例 #10
0
        Route::post('/upload-slider', 'SliderController@upload');
    });
    Route::get('/speciality', 'SpecialitiesController@create');
    Route::group(['prefix' => 'speciality'], function () {
        Route::post('/save', 'SpecialitiesController@store');
        Route::post('/delete', 'SpecialitiesController@destroy');
    });
    Route::get('/user', 'UsersController@create');
    Route::group(['prefix' => 'user'], function () {
        Route::post('/save', 'UsersController@store');
        Route::post('/update', 'UsersController@update');
        Route::post('/show', 'UsersController@show');
        Route::post('/activate', 'UsersController@activate');
    });
    /*
    Route::get('/clientes/{cliente}/{reporte}', 'FilesController@getFileNames');
    
    Route::get('/clientes', function(){
    return View::make('clientes');
    });
    
    Route::post('/upload-file/{cliente}/{reporte}','FilesController@uploadFile');
    
    Route::get('/delete_file','FilesController@deleteFile');
    
    Route::get('/send-email/{cliente}/{reporte}','HomeController@sendEmail');
    */
});
App::missing(function ($exception) {
    return Response::view('errors.404');
});
コード例 #11
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 Closure to execute when that URI is requested.
|
*/
// Auth Filter
Route::filter('sentry_auth', function () {
    // If user is not logged in redirect to login page
    if (!Sentry::check()) {
        return Redirect::to('/');
    }
});
/**
 * APIs
 */
Route::group(array('before' => 'sentry_auth'), function () {
    Route::resource('booking', 'BookingController');
});
Route::get('logout', array('uses' => 'BookingController@getLogout'));
Route::controller('/', 'HomeController');
App::missing(function ($exception) {
    return View::make('home.index');
});
コード例 #12
0
ファイル: global.php プロジェクト: jaymondigo/custommade
/*
|--------------------------------------------------------------------------
| Maintenance Mode Handler
|--------------------------------------------------------------------------
|
| The "down" Artisan command gives you the ability to put an application
| into maintenance mode. Here, you will define what is displayed back
| to the user if maintenace mode is in effect for this application.
|
*/
App::down(function () {
    return Response::make("Be right back!", 503);
});
App::missing(function ($exception) {
    if (Auth::guest()) {
        return Redirect::to('/');
    } else {
        return Response::view('errors.404', array(), '404');
    }
});
/*
|--------------------------------------------------------------------------
| Require The Filters File
|--------------------------------------------------------------------------
|
| Next we will load the filters file for the application. This gives us
| a nice separate location to store our route and application filter
| definitions instead of putting them all in the main routes file.
|
*/
require app_path() . '/filters.php';
コード例 #13
0
ファイル: routes.php プロジェクト: shubhomoy/evolve
<?php

include 'routes/public.php';
Route::group(['prefix' => 'api'], function () {
    include 'routes/api.php';
});
App::missing(function ($exception) {
    return Response::unauthorized();
});
Route::get('/api/search/doctors', 'DoctorController@search');
Route::get('/api/specializations', 'DoctorController@showAllSpecializations');
Route::post('/auth/doctor/signup', 'DoctorController@signup');
Route::post('/auth/doctor/login', 'DoctorController@login');
Route::get('/api/clinic/{id}', 'ClinicController@show');
Route::get('/api/clinics', 'ClinicController@index');
Route::post('/api/appointment', 'AppointmentController@makeAppointment');
Route::post('/api/appointment/verify', 'AppointmentController@verifyAppointment');
Route::get('/seealldocs', function () {
    return Response::json(['doctors' => Doctor::all()]);
});
コード例 #14
0
ファイル: routes.php プロジェクト: AbhishekDutt/MUnicorn
    	GET			/resource						index		resource.index
    	GET			/resource/create				create		resource.create
    	POST		/resource						store		resource.store
    	GET			/resource/{resource}			show		resource.show
    	GET			/resource/{resource}/edit		edit		resource.edit
    	PUT/PATCH	/resource/{resource}			update		resource.update
    	DELETE		/resource/{resource}			destroy		resource.destroy
    */
});
// API routes for Landing Page Urls operations
Route::group(array('prefix' => 'api/'), function () {
    Route::resource('landingpageurls', 'LandingPageUrlsController');
});
// Resource Routes for User management
Route::group(array('prefix' => 'api/'), function () {
    Route::resource('users', 'UserController');
});
// API routes for WordCloud	// NOT the landing Page word cloud
Route::group(array('prefix' => 'api/wordcloud'), function () {
    // Step 5 : Download word cloud string
    Route::get('/gettagcloud/{dataaccountid}', 'WordController@index');
    // Step 5 : delete delete Ids and save segmets
    Route::post('/savesegmentmap/{dataaccount}', 'WordController@saveSegmentMap');
});
////////////////////////// USER AUTHENTICATION
// Catch all route
App::missing(function ($exception) {
    return "XXXX PATH ERROR";
    return var_dump($exception);
    return View::make('index');
});
コード例 #15
0
|
| Here you may handle any errors that occur in your application, including
| logging them or displaying custom views for specific errors. You may
| even register several error handlers to handle different types of
| exceptions. If nothing is returned, the default error view is
| shown, which includes a detailed stack trace during debug.
|
*/
App::error(function (Exception $exception, $code) {
    Log::error($exception);
    return Response::view('error', ['error' => 'A website error has occurred.
        The website administrator has been notified of the issue.
        Sorry for the temporary inconvenience.'], 500);
});
App::missing(function ($exception) {
    return Response::view('error', ['error' => '404 Not Found.'], 404);
});
/*
|--------------------------------------------------------------------------
| Maintenance Mode Handler
|--------------------------------------------------------------------------
|
| The "down" Artisan command gives you the ability to put an application
| into maintenance mode. Here, you will define what is displayed back
| to the user if maintenance mode is in effect for the application.
|
*/
App::down(function () {
    return Response::make("Be right back!", 503);
});
/*
コード例 #16
0
ファイル: routes.php プロジェクト: nsmith7989/spreadsheet
| and give it the Closure to execute when that URI is requested.
|
*/
Route::get('/', array('before' => 'auth', function () {
    return Redirect::to('transactions');
}));
// =======================================
// Login Routes
// =======================================
//shows the login form
Route::get('login', array('uses' => 'HomeController@showLogin'));
Route::post('login', array('uses' => 'HomeController@doLogin'));
Route::get('logout', array('uses' => 'HomeController@doLogout'));
// =======================================
// UserCRUD
// =======================================
Route::group(array('before' => 'auth'), function () {
    Route::resource('users', 'UsersController');
});
// =======================================
// TRANSACTION ROUTES
// =======================================
Route::group(array('before' => 'auth'), function () {
    Route::resource('transactions', 'TransactionController');
});
// =======================================
// CATCH C'HALL
// =======================================
App::missing(function ($exception) {
    return Redirect::to('transactions');
});
コード例 #17
0
ファイル: global.php プロジェクト: jgbneatdesign/tikwenpam
});
App::error(function (Illuminate\Database\Eloquent\ModelNotFoundException $e) {
    return View::make('pages.404');
});
/*
|--------------------------------------------------------------------------
| Maintenance Mode Handler
|--------------------------------------------------------------------------
|
| The "down" Artisan command gives you the ability to put an application
| into maintenance mode. Here, you will define what is displayed back
| to the user if maintenance mode is in effect for the application.
|
*/
App::down(function () {
    return Response::make("Be right back!", 503);
});
App::missing(function () {
    return View::make('pages.404');
});
/*
|--------------------------------------------------------------------------
| Require The Filters File
|--------------------------------------------------------------------------
|
| Next we will load the filters file for the application. This gives us
| a nice separate location to store our route and application filter
| definitions instead of putting them all in the main routes file.
|
*/
require app_path() . '/filters.php';
コード例 #18
0
ファイル: routes.php プロジェクト: kylekatarnls/insearch
Route::post('/add-url', 'HomeController@addUrl')->before('csrf');
Route::get('/error/wrong-token', 'BaseController@wrongToken');
// Résultats les plus populaires
Route::get('/most-popular/{page}/{resultsPerPage?}', 'HomeController@mostPopular');
// Résultats des précédentes recherches
Route::get('/history/{page}/{resultsPerPage?}', 'HomeController@history');
// Auto-complétion
Route::post('/autocomplete', function () {
    return LogSearch::startWith(Input::get('q'));
});
// URLs accessibles uniquement en environement de développement
if (Config::get('app.debug')) {
    Route::get('/specs/1', 'DevController@specs');
    Route::get('/lang/csv', function () {
        return Response::download(Utils\Lang\CSV::convert());
    });
}
//// Espace membre
// Connexion
Route::get('/user/login', 'UserController@login');
Route::post('/user/login', 'UserController@tryLogin')->before('csrf');
Route::get('/user/logout', 'UserController@logout');
// Inscription
Route::get('/user/signin', 'UserController@signin');
Route::post('/user/signin', 'UserController@trySignin')->before('csrf');
// Administration des utilisateurs
Route::get('/user/list', 'UserController@listAll');
// Gestion de l'erreur 404
App::missing(function () {
    return BaseController::notFound();
});
コード例 #19
0
ファイル: global.php プロジェクト: thunderclap560/quizkpop
App::error(function (Exception $exception, $code) {
    $pathInfo = Request::getPathInfo();
    $message = $exception->getMessage() ?: 'Exception';
    Log::error("{$code} - {$message} @ {$pathInfo}\r\n{$exception}");
    if (Config::get('app.debug')) {
        return;
    }
    return Response::view('errors/500', array(), 500);
});
//404 macro
Response::macro('notFound', function ($value = null) {
    QuizController::_loadQuizes();
    return Response::view('errors.404', array('errorMsg' => strtoupper($value)), 404);
});
App::missing(function ($exception) {
    QuizController::_loadQuizes();
    return Response::view('errors.404', array('errorMsg' => strtoupper($exception->getMessage())), 404);
});
Response::macro('error', function ($message, $title = null, $errorCode = 500) {
    if (Request::ajax()) {
        return Response::make($message, $errorCode);
    } else {
        return Response::view('errors.error', array('title' => $title, 'message' => $message), $errorCode);
    }
});
Response::macro('configurationError', function ($message, $title = null, $errorCode = 500) {
    if (Request::ajax()) {
        $response = $title . '<br>' . $message;
    } else {
        $response = View::make('errors.plainError')->with(array('title' => $title, 'message' => $message));
    }
    die($response);
コード例 #20
0
| shown, which includes a detailed stack trace during debug.
|
*/
App::error(function (Exception $exception, $code) {
    Log::error($exception);
});
/*
|--------------------------------------------------------------------------
| Application 404 Handler
|--------------------------------------------------------------------------
|
| Here you may handle any 404 errors that occur in your application.
|
*/
App::missing(function ($exception) {
    $content = View::make('404');
    return Response::make($content, 404);
});
/*
|--------------------------------------------------------------------------
| Maintenance Mode Handler
|--------------------------------------------------------------------------
|
| The "down" Artisan command gives you the ability to put an application
| into maintenance mode. Here, you will define what is displayed back
| to the user if maintenace mode is in effect for this application.
|
*/
App::down(function () {
    return Response::make("Be right back!", 503);
});
/*
コード例 #21
0
ファイル: routes.php プロジェクト: utkarshx/learninglocker
    $bridgedResponse = App::make('oauth2')->handleTokenRequest($bridgedRequest, $bridgedResponse);
    return $bridgedResponse;
});
//Add OPTIONS routes for all defined xAPI and api routes
foreach (Route::getRoutes()->getIterator() as $route) {
    if ($route->getPrefix() === 'data/xAPI' || $route->getPrefix() === 'api/v1') {
        Route::options($route->getUri(), 'Controllers\\API\\Base@CORSOptions');
    }
}
/*
|------------------------------------------------------------------
| For routes that don't exist
|------------------------------------------------------------------
*/
App::missing(function ($exception) {
    if (Request::segment(1) == "data" || Request::segment(1) == "api") {
        $error = array('error' => true, 'message' => $exception->getMessage(), 'code' => $exception->getStatusCode());
        return Response::json($error, $exception->getStatusCode());
    } else {
        return Response::view('errors.missing', array('message' => $exception->getMessage()), 404);
    }
});
App::error(function (Exception $exception) {
    Log::error($exception);
    $code = method_exists($exception, 'getStatusCode') ? $exception->getStatusCode() : 500;
    if (Request::segment(1) == "data" || Request::segment(1) == "api") {
        return Response::json(['error' => true, 'success' => false, 'message' => method_exists($exception, 'getErrors') ? $exception->getErrors() : $exception->getMessage(), 'code' => $code, 'trace' => Config::get('app.debug') ? $exception->getTrace() : trans('api.info.trace')], $code);
    } else {
        echo "Status: " . $code . " Error: " . $exception->getMessage();
    }
});
コード例 #22
0
*/
App::error(function (Exception $exception, $code) {
    Log::error($exception);
});
/*
|--------------------------------------------------------------------------
| Maintenance Mode Handler
|--------------------------------------------------------------------------
|
| The "down" Artisan command gives you the ability to put an application
| into maintenance mode. Here, you will define what is displayed back
| to the user if maintenance mode is in effect for the application.
|
*/
App::down(function () {
    return Response::make("Be right back!", 503);
});
/*
|--------------------------------------------------------------------------
| Require The Filters File
|--------------------------------------------------------------------------
|
| Next we will load the filters file for the application. This gives us
| a nice separate location to store our route and application filter
| definitions instead of putting them all in the main routes file.
|
*/
require app_path() . '/filters.php';
App::missing(function ($exception) {
    return Redirect::to('/');
});
コード例 #23
0
ファイル: global.php プロジェクト: anam48/tickets3
App::error(function (Exception $exception, $code) {
    Log::error($exception);
});
/*
|--------------------------------------------------------------------------
| Maintenance Mode Handler
|--------------------------------------------------------------------------
|
| The "down" Artisan command gives you the ability to put an application
| into maintenance mode. Here, you will define what is displayed back
| to the user if maintenance mode is in effect for the application.
|
*/
App::down(function () {
    return Response::make("Be right back!", 503);
});
/*
|--------------------------------------------------------------------------
| Require The Filters File
|--------------------------------------------------------------------------
|
| Next we will load the filters file for the application. This gives us
| a nice separate location to store our route and application filter
| definitions instead of putting them all in the main routes file.
|
*/
require app_path() . '/filters.php';
/*Mensaje pagina no encontrada*/
App::missing(function ($exception) {
    return Response::make("Página no encontrada", 404);
});
コード例 #24
0
ファイル: filters.php プロジェクト: Grapheme/doktornarabote
            /*
            		case 404:
            			#if(Page::where('seo_url','404')->exists()):
            			#	return spage::show('404',array('message'=>$exception->getMessage()));
            			#else:
            			#	return View::make('error404', array('message'=>$exception->getMessage()), 404);
            			#endif;
            */
    }
    if (View::exists(Helper::layout($code))) {
        return Response::view(Helper::layout($code), array('message' => $exception->getMessage()), $code);
    }
});
App::missing(function ($exception) {
    #Helper::classInfo('Route');
    #Helper::dd(get_declared_classes());
    $tpl = View::exists(Helper::layout('404')) ? Helper::layout('404') : 'error404';
    return Response::view($tpl, array('message' => $exception->getMessage()), 404);
});
Route::filter('auth', function () {
    if (Auth::guest()) {
        App::abort(404);
    }
});
Route::filter('login', function () {
    if (Auth::check()) {
        return Redirect::to(AuthAccount::getStartPage());
    }
});
Route::filter('auth.basic', function () {
    return Auth::basic();
});
コード例 #25
0
ファイル: routes.php プロジェクト: joshreisner/avalon
<?php

Route::group(array('prefix' => Config::get('avalon::route_prefix')), function () {
    if (Auth::guest() || empty(Auth::user()->role)) {
        # Unprotected login routes
        Route::get('/', array('as' => 'home', 'uses' => 'LoginController@getIndex'));
        Route::post('/', 'LoginController@postIndex');
        Route::get('/reset', 'LoginController@getReset');
        Route::post('/reset', 'LoginController@postReset');
        Route::get('/change/{email}/{token}', 'LoginController@getChange');
        Route::post('/change', 'LoginController@postChange');
        App::missing(function ($exception) {
            return Redirect::route('home');
        });
    } else {
        # Admins only
        Route::group(array('before' => 'admin', 'prefix' => 'avalon'), function () {
            Route::resource('users', 'UserController');
            Route::get('/users/{user_id}/delete', 'UserController@delete');
            Route::get('/users/{user_id}/resend-welcome', 'UserController@resendWelcome');
        });
        # Programmers only
        Route::group(array('before' => 'programmer'), function () {
            # Edit table
            Route::get('/create', 'ObjectController@create');
            Route::post('/', 'ObjectController@store');
            Route::get('/{object_name}/edit', 'ObjectController@edit');
            Route::put('/{object_name}', 'ObjectController@update');
            Route::delete('/{object_name}', 'ObjectController@destroy');
            # Edit fields
            Route::get('/{object_name}/fields', 'FieldController@index');
コード例 #26
0
ファイル: routes.php プロジェクト: walheredia/expo
    Route::get('edit_articulo{id}', 'ArticulosController@getEditArticulo')->where('id', '[0-9]+');
    Route::post('edit_articulo', 'ArticulosController@update');
    //Rubros
    Route::get('register_rubro', 'RubrosController@get_nuevo');
    Route::post('register_rubro', 'RubrosController@post_nuevo');
    Route::get('lista_rubros', 'RubrosController@all_rubros');
    //Localidades
    Route::get('register_localidad', 'LocalidadesController@get_nuevo');
    Route::post('register_localidad', 'LocalidadesController@post_nuevo');
    Route::get('lista_localidades', 'LocalidadesController@all_localidades');
    //Stock
    Route::get('edit_stock{id}', 'StockController@getEditStock')->where('id', '[0-9]+');
    Route::post('edit_stock', 'StockController@update');
});
App::missing(function ($exception) {
    return "Exception";
});
/*Route::get('/', 'HomeController@showWelcome');

// Rutas de /usuario
Route::get('usuario', 'UserController@getIndex');

//Pestañas de inscripcion
Route::get('inscripcion','AlumnController@getIndex');
Route::get('inscripcion/alumno', 'AlumnController@getTabAlumno');
Route::get('inscripcion/familiares', 'AlumnController@getTabFamiliares');
Route::get('inscripcion/salud', 'AlumnController@getTabSalud');
Route::get('inscripcion/sae', 'AlumnController@getTabSae');

Route::get('inscripcion/alumno/{id}', 'AlumnController@getEditTabAlumno')->where('id', '[0-9]+');
Route::get('inscripcion/familiares/{id}', 'AlumnController@getEditTabFamiliares')->where('id', '[0-9]+');
コード例 #27
0
ファイル: routes.php プロジェクト: fencer-md/stoticlle
    $view->with('moneyAvailable', $userMoneyAvailable);
});
View::creator('includes.backend.cycles', function ($view) {
    $uid = Auth::user()->id;
    $lastInvest = Transaction::where('user_id', '=', $uid)->where('transaction_direction', '=', 'invested')->orderBy('id', 'DESC')->first();
    $amount = 0;
    if ($lastInvest) {
        $amount = $lastInvest->ammount;
    }
    $view->with('lastInvestedAmmount', $amount);
});
View::creator('homepage', function ($view) {
    $blocks = Block::all();
    // TODO: Improve this part. Add validation.
    foreach ($blocks as $block) {
        $block->content = json_decode($block->content);
    }
    $view->with('blocks', $blocks);
});
App::missing(function ($exception) {
    return Response::view('errors/404', array(), 404);
});
Route::get('rules', function () {
    return View::make('rules');
});
Route::get('news', function () {
    return View::make('news');
});
Route::get('about-us', function () {
    return View::make('about_us');
});
コード例 #28
0
ファイル: global.php プロジェクト: enterpi-123/demo
|--------------------------------------------------------------------------
|
| Here you may handle any errors that occur in your application, including
| logging them or displaying custom views for specific errors. You may
| even register several error handlers to handle different types of
| exceptions. If nothing is returned, the default error view is
| shown, which includes a detailed stack trace during debug.
|
*/
App::error(function (Exception $exception, $code) {
    Log::error($exception);
    //return Redirect::to('errorExceptionPage');
});
App::missing(function ($e) {
    $url = Request::fullUrl();
    Log::warning("404 for URL: {$url}");
    return Response::view('errors.notFound', array(), 404);
});
/*
|--------------------------------------------------------------------------
| Maintenance Mode Handler
|--------------------------------------------------------------------------
|
| The "down" Artisan command gives you the ability to put an application
| into maintenance mode. Here, you will define what is displayed back
| to the user if maintenance mode is in effect for the application.
|
*/
App::down(function () {
    return Response::make("Be right back!", 503);
});
コード例 #29
0
ファイル: routes.php プロジェクト: juanantoniofr/sgr
Route::post('editajaxevent', array('uses' => 'EventoController@edit', 'before' => array('auth', 'ajax_check')));
Route::get('geteventbyId', array('uses' => 'EventoController@getbyId', 'before' => array('auth', 'ajax_check')));
Route::get('tecnico/geteventbyId', array('uses' => 'EventoController@getbyId', 'before' => array('auth', 'ajax_check')));
Route::post('delajaxevent', array('uses' => 'EventoController@del', 'before' => array('auth', 'ajax_check')));
Route::post('finalizaevento', array('uses' => 'EventoController@finalizar', 'before' => array('auth', 'ajax_check')));
Route::post('anulaevento', array('uses' => 'EventoController@anular', 'before' => array('auth', 'ajax_check')));
//***
//Atención de eventos
Route::get('tecnico/getUserEvents', array('uses' => 'EventoController@getUserEvents', 'before' => array('auth', 'capacidad:3-4,msg')));
Route::post('tecnico/saveAtencion', array('uses' => 'EventoController@atender', 'before' => array('auth', 'capacidad:3-4,msg')));
Route::get('print', array('uses' => 'CalendarController@imprime'));
Route::get('report', array('as' => 'report.html', 'uses' => 'AuthController@report'));
App::missing(function ($exception) {
    $pagetitle = Config::get('msg.404pagetitleLogin');
    $paneltitle = Config::get('msg.404paneltitle');
    $msg = Config::get('msg.404msg');
    $alertLevel = 'warning';
    return View::make('message')->with(compact('msg', 'pagetitle', 'paneltitle', 'alertLevel'));
});
App::error(function (ModelNotFoundException $e) {
    $pagetitle = Config::get('msg.objectNoFoundpagetitle');
    $paneltitle = Config::get('msg.objectNoFoundpagetitlepaneltitle');
    $msg = Config::get('msg.objectNoFoundmsg');
    $alertLevel = 'danger';
    return View::make('message')->with(compact('msg', 'pagetitle', 'paneltitle', 'alertLevel'));
});
//**
Route::get('test', array('as' => 'test', function () {
    $recurso = Recurso::findOrFail('115');
    $sgrRecurso = Factoria::getRecursoInstance($recurso);
    echo $sgrRecurso->delEventos();
コード例 #30
0
ファイル: global.php プロジェクト: austenpayan/madison
<?php

App::missing(function ($exception) {
    return Response::json(array('text' => 'API route not found.', 'severity' => 'error'), 404);
});
/*
* Merge social login credentials to ENV
*/
if (file_exists(base_path() . '/.env.socials.php')) {
    $social_config = (require base_path() . '/.env.socials.php');
    $_ENV = array_merge($_ENV, $social_config);
}
/*
|--------------------------------------------------------------------------
| Register The Laravel Class Loader
|--------------------------------------------------------------------------
|
| In addition to using Composer, you may use the Laravel class loader to
| load your controllers and models. This is useful for keeping all of
| your classes in the "global" namespace without Composer updating.
|
*/
ClassLoader::addDirectories(array(app_path() . '/commands', app_path() . '/controllers', app_path() . '/models', app_path() . '/database/seeds', app_path() . '/events'));
/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
| Here we will configure the error logger setup for the application which
| is built on top of the wonderful Monolog library. By default we will
| build a rotating log file setup which creates a new file each day.