Browse Source

Merge branch 'master' of github.com:laravel/laravel

Taylor Otwell 11 years ago
parent
commit
60ad02ad01
2 changed files with 13 additions and 1 deletions
  1. 1 1
      laravel/documentation/controllers.md
  2. 12 0
      laravel/routing/route.php

+ 1 - 1
laravel/documentation/controllers.md

@@ -98,7 +98,7 @@ In this example the auth filter will be run before the action_index() or action_
 
 	$this->filter('before', 'auth')->except(array('add', 'posts'));
 
-Much like the previous example, this declaration ensures that the auth filter is run on only some of this controller's actions.  Instead of declaring to which actions the filter applies we are instead declaring the actions that will not require authenticated sessions.  It can sometimes be safer to use the 'except' method as it's possible to add new actions to this controller and to forget to add them to only().  This could potentially lead your controller's action being unintentionally accessible by users who haven't been authenticated.
+Much like the previous example, this declaration ensures that the auth filter is run on only some of this controller's actions.  Instead of declaring to which actions the filter applies we are instead declaring the actions that will not require authenticated sessions.  It can sometimes be safer to use the 'except' method as it's possible to add new actions to this controller and to forget to add them to only().  This could potentially lead to your controller's action being unintentionally accessible by users who haven't been authenticated.
 
 #### Attaching a filter to run on POST:
 

+ 12 - 0
laravel/routing/route.php

@@ -330,6 +330,18 @@ class Route {
 		Router::register('PUT', $route, $action);
 	}
 
+	/**
+	 * Register a PATCH route with the router.
+	 *
+	 * @param  string|array  $route
+	 * @param  mixed         $action
+	 * @return void
+	 */
+	public static function patch($route, $action)
+	{
+		Router::register('PATCH', $route, $action);
+	}
+
 	/**
 	 * Register a DELETE route with the router.
 	 *