Questions tagged [laravel-routing]

Routing in Laravel Framework's MVC implementation. Laravel is a free, open source PHP web application framework, and it is released under the MIT license.

laravel-routing is a tag suitable for any questions regarding routing in Laravel's MVC implementation, url handling, or any other matter affecting or affected by routing in Laravel.

2207 questions
48
votes
4 answers

Access query string values from Laravel

Does anyone know if it's possible to make use of URL query's within Laravel. Example I have the following route: Route::get('/text', 'TextController@index'); And the text on that page is based on the following url…
Melvin Koopmans
  • 2,994
  • 2
  • 25
  • 33
47
votes
8 answers

How to use the request route parameter in Laravel 5 form request?

I am new to Laravel 5 and I am trying to use the new Form Request to validate all forms in my application. Now I am stuck at a point where I need to DELETE a resource and I created a DeleteResourceRequest for just to use the authorize method. The…
Rohan
  • 13,308
  • 21
  • 81
  • 154
40
votes
9 answers

Can I group multiple domains in a routing group in Laravel?

Let's say I have the following: Route::group(array('domain' => array('admin.example.com')), function() { ... }); Route::group(array('domain' => array('app.example.com')), function() { ... }); Route::group(array('domain' =>…
Andy Fleming
  • 7,655
  • 6
  • 33
  • 53
35
votes
4 answers

Laravel error: Missing required parameters for route

I keep getting this error ErrorException in UrlGenerationException.php line 17: When ever any page loads and I'm logged in. Here is what my nav looks like @if(Auth::guest())
  • Log In
  • Skel
    • 1,611
    • 3
    • 16
    • 36
    34
    votes
    3 answers

    Laravel 5 Function () not found

    I'm putting together a site which has a protected section where users must be logged in to access. I've done this in Laravel 4 without too much incident. However, for the life of me I cannot figure out why I can't get it to work in Laravel 5(L5). In…
    joseph
    • 454
    • 1
    • 5
    • 12
    34
    votes
    3 answers

    Laravel Route model binding with relationship

    I am wondering if it is possible to return a relationship with laravels Route model binding ? Say is a have a user model with a relationship 'friends' to other users, and I want to return both the user info and the relationship from a route or…
    Keith
    • 1,136
    • 2
    • 13
    • 30
    32
    votes
    9 answers

    laravel 5 custom 404

    This is driving me crazy. I'm working with Laravel 5 and it appears that the docs for 4.2 and generating 404 pages does not work. First, there is no global.php so I tried putting the following in routes.php: App::missing(function($exception) { …
    user4147717
    31
    votes
    3 answers

    Get fullUrl in laravel 5.1

    i have multiple bootstrap tabs where each one do different action from others tabs for exmaple app-url/users#creat-admin-users-tab app-url/users#creat-regular-users-tab Is there any way in Laravel to get full url including the #tab-name Thanks for…
    Muhammad Atallah
    • 976
    • 2
    • 12
    • 34
    31
    votes
    3 answers

    How to route to a static folder in Laravel

    I have a folder I've placed in the /public folder in my Laravel site. The path is: /public/test the "test" folder has a file called index.html that is just a static resource I want to load from the public folder (I don't want to create a view for…
    ChiCgi
    • 735
    • 1
    • 6
    • 11
    29
    votes
    2 answers

    Laravel: Get URL from routes BY NAME

    I'm trying to do something a little different and I couldn't find any way to do it. Maybe my approach is wrong but either way I figured I might find some help here. I have a Laravel 5 project and you know how you can get the current route name by…
    brunomayerc
    • 295
    • 1
    • 3
    • 8
    29
    votes
    2 answers

    Laravel Middleware except with Route::group

    I'm trying to create a group Route for the admin section and apply the middleware to all paths except for login and logout. What I have so far is: Route::group(['prefix' => 'admin', 'namespace' => 'Admin', 'middleware' => 'authAdmin'], function()…
    Sebastian Sulinski
    • 5,815
    • 7
    • 39
    • 61
    28
    votes
    3 answers

    Laravel How to remove "api" Prefix from subdomain URL

    I have created a Laravel application which is both Web application and provides REST APIs to android and iOS platforms. I have two route files one is api.php and other is web.php and routes\api.php routing as follows: routes/api.php …
    Lakshmaji
    • 899
    • 2
    • 14
    • 30
    25
    votes
    5 answers

    Previous route name in Laravel 5.1-5.8

    I try to find name of previous route in Laravel 5.1. With: {!! URL::previous() !!} I get the route url, but I try to get route name like I get for current page: {!! Route::current()->getName() !!} My client wont a different text for Thank you…
    Akul Von Itram
    • 1,428
    • 2
    • 20
    • 31
    21
    votes
    3 answers

    Call to undefined method Illuminate\Routing\Route::get()

    I have just installed Laravel 5.1, visited the home page of my app and i get the following error: Whoops, looks like something went wrong. 1/1 FatalErrorException in routes.php line 16: Call to undefined method Illuminate\Routing\Route::get() in…
    showFocus
    • 701
    • 2
    • 8
    • 21
    21
    votes
    4 answers

    Install Laravel 5 app in subdirectory with htaccess

    The Setup I am trying to install a laravel 5 app in this directory on my server: public_html/myapp/ And I want it to be accessed at this URL: http://www.example.com/myapp/ I have created this .htaccess rule and placed it in the myapp folder in order…
    Ben Cole
    • 1,847
    • 1
    • 15
    • 18