Route::patch PHP Method

patch() public static method

Register a new PATCH route with the router.
public static patch ( string $uri, Closure | array | string | null $action = null ) : Illuminate\Routing\Route
$uri string
$action Closure | array | string | null
return Illuminate\Routing\Route
        public static function patch($uri, $action = null)
        {
            return \Illuminate\Routing\Router::patch($uri, $action);
        }

Usage Example

Example #1
0
 public function setRoutes()
 {
     $pages = collect(\Config::get('pages'));
     foreach ($pages as $page) {
         if (!$page['uses']) {
             continue;
         }
         switch ($page['method']) {
             case 'get':
                 \Route::get($this->getUri($page), ['as' => $this->getName($page), 'uses' => $page['uses']]);
                 break;
             case 'post':
                 \Route::post($this->getUri($page), ['as' => $this->getName($page), 'uses' => $page['uses']]);
                 break;
             case 'patch':
                 \Route::patch($this->getUri($page), ['as' => $this->getName($page), 'uses' => $page['uses']]);
                 break;
             case 'delete':
                 \Route::patch($this->getUri($page), ['as' => $this->getName($page), 'uses' => $page['uses']]);
                 break;
             case 'any':
                 \Route::any($this->getUri($page), ['as' => $this->getName($page), 'uses' => $page['uses']]);
         }
     }
 }
All Usage Examples Of Route::patch