Esempio n. 1
0
 /**
  * @param Route $newRoute
  * @throws RouterException
  */
 public function add(Route $newRoute)
 {
     foreach ($this->routes as $route) {
         if ($newRoute->getMethod() == $route->getMethod() and $newRoute->getPath() == $route->getPath()) {
             throw new RouterException("Route {$route->getPath()} has already added to the route collection.");
         }
     }
     $this->routes[] = $newRoute;
 }
Esempio n. 2
0
<?php

use App\Routing\Route;
return [Route::create('POST', '/getCustomers', 'CustomersController@getCustomers'), Route::create('GET', '/', 'CustomersController@index')];