removed routes directory
This commit is contained in:
parent
12185bd4db
commit
8068a88b87
|
@ -1,70 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
return array(
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Filters
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| Filters provide a convenient method for attaching functionality to your
|
|
||||||
| routes. Filters can run either before or after a route is exectued.
|
|
||||||
|
|
|
||||||
| The built-in "before" and "after" filters are called before and after
|
|
||||||
| every request to your application; however, you may create other filters
|
|
||||||
| that can be attached to individual routes.
|
|
||||||
|
|
|
||||||
| Filters also make common tasks such as authentication and CSRF protection
|
|
||||||
| a breeze. If a filter that runs before a route returns a response, that
|
|
||||||
| response will override the route action.
|
|
||||||
|
|
|
||||||
| Let's walk through an example...
|
|
||||||
|
|
|
||||||
| First, define a filter:
|
|
||||||
|
|
|
||||||
| 'simple_filter' => function()
|
|
||||||
| {
|
|
||||||
| return 'Filtered!';
|
|
||||||
| }
|
|
||||||
|
|
|
||||||
| Next, attach the filter to a route:
|
|
||||||
|
|
|
||||||
| 'GET /' => array('before' => 'simple_filter', 'do' => function()
|
|
||||||
| {
|
|
||||||
| return 'Hello World!';
|
|
||||||
| })
|
|
||||||
|
|
|
||||||
| Now every requests to http://example.com will return "Filtered!", since
|
|
||||||
| the filter is overriding the route action by returning a value.
|
|
||||||
|
|
|
||||||
| To make your life easier, we have built authentication and CSRF filters
|
|
||||||
| that are ready to attach to your routes. Enjoy.
|
|
||||||
|
|
|
||||||
| For more information, check out: http://laravel.com/docs/start/routes#filters
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'before' => function()
|
|
||||||
{
|
|
||||||
// Do stuff before every request is executed.
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
'after' => function($response)
|
|
||||||
{
|
|
||||||
// Do stuff after every request is executed.
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
'auth' => function()
|
|
||||||
{
|
|
||||||
return ( ! Auth::check()) ? Redirect::to_login() : null;
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
'csrf' => function()
|
|
||||||
{
|
|
||||||
return (Input::get('csrf_token') !== Form::raw_token()) ? Response::error('500') : null;
|
|
||||||
},
|
|
||||||
|
|
||||||
);
|
|
|
@ -1,47 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
return array(
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Application Routes
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| Here is the public API of your application. To add functionality to your
|
|
||||||
| application, you just add to the array located in this file.
|
|
||||||
|
|
|
||||||
| Simply tell Laravel the HTTP verbs and request URIs it should respond to.
|
|
||||||
| You may respond to the GET, POST, PUT, or DELETE verbs. Enjoy the simplicity
|
|
||||||
| and elegance of RESTful routing.
|
|
||||||
|
|
|
||||||
| Here is how to respond to a simple GET request to http://example.com/hello:
|
|
||||||
|
|
|
||||||
| 'GET /hello' => function()
|
|
||||||
| {
|
|
||||||
| return 'Hello World!';
|
|
||||||
| }
|
|
||||||
|
|
|
||||||
| You can even respond to more than one URI:
|
|
||||||
|
|
|
||||||
| 'GET /hello, GET /world' => function()
|
|
||||||
| {
|
|
||||||
| return 'Hello World!';
|
|
||||||
| }
|
|
||||||
|
|
|
||||||
| Allow URI wildcards using the (:num) or (:any) place-holders:
|
|
||||||
|
|
|
||||||
| 'GET /hello/(:any)' => function($name)
|
|
||||||
| {
|
|
||||||
| return "Welcome, $name.";
|
|
||||||
| }
|
|
||||||
|
|
|
||||||
| Ready to learn more? Check out: http://laravel.com/docs/start/routes
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'GET /' => function()
|
|
||||||
{
|
|
||||||
return View::make('home/index');
|
|
||||||
},
|
|
||||||
|
|
||||||
);
|
|
Loading…
Reference in New Issue