Route::has PHP Method

has() public static method

Check if a route with the given name exists.
public static has ( string $name ) : boolean
$name string
return boolean
        public static function has($name)
        {
            return \Illuminate\Routing\Router::has($name);
        }

Usage Example

Exemplo n.º 1
0
 public function testApplicationLogout()
 {
     /*
      * Laravel 5.3's logout route redirects to '/'
      * Easel does not provide a '/' route by default so for the purpose of testing
      * Create a test route so that the logout redirects properly
      */
     if (!\Route::has('/')) {
         \Route::get('/', '\\Easel\\Http\\Controllers\\Frontend\\BlogController@index');
     }
     $this->actingAs($this->user)->seeIsAuthenticatedAs($this->user)->visit('/admin/post')->click('Sign out')->seePageIs('/')->dontSeeIsAuthenticated();
 }
All Usage Examples Of Route::has