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
4
votes
1 answer

Laravel 5.0 - Where to use bindings from Service Providers?

In my App\Providers\RouteServiceProvider I did create the method register: public function register() { $this->app->bindShared('JustTesting', function($app) { die('got here!'); // return new MyClass; }); } Where should I…
Giovanne Afonso
  • 666
  • 7
  • 21
4
votes
1 answer

Going to next matching route if no model was found

Let's assume we have 2 such routes: Route::get('{categoryitem}', ['as' => 'category_index', 'uses' => 'CategoryDisplayController@index']); Route::get('{entryitem}', ['as' => 'entry', 'uses' => 'EntryController@show']); There are no parameter…
Marcin Nabiałek
  • 109,655
  • 42
  • 258
  • 291
4
votes
1 answer

Login and registration form in Laravel 5

I start to learn a new laravel and trying to learn it, by building small project, to make my starter site, but I have a problem. I only create new project without any plugin. I have a problem with login and register form. I put this into route…
mrakodol
  • 1,143
  • 3
  • 12
  • 41
4
votes
2 answers

(Laravel) How to use 2 controllers in 1 route?

How can I use 2 controllers in 1 route? The goal here is to create multiple pages with 1 career each (e.g: Accountants) then link them to a school providing an Accounting course. An example page would consist of: 1. Accountants career information…
Stanley Tan
  • 433
  • 1
  • 7
  • 21
4
votes
2 answers

Is there a way to mix static with dynamic routes in Laravel 4?

Im wondering if there is a way to specify static routes, along with a way to dynamically look up a root level page url, something like below would be in my routes.php file Route::get('admin/users', array('before' => 'isAdmin', 'uses' =>…
Gabriel Alack
  • 472
  • 2
  • 6
  • 16
4
votes
1 answer

Specifying a route name in Redirect::intended

I would like to get a route value by its name and store it in a variable. The reason being, I would like to use the Redirect::intended($url) method to redirect the user to a route instead of just putting the url there. Basically, I would like to…
Yassir Ennazk
  • 6,970
  • 4
  • 31
  • 37
4
votes
2 answers

Changing controller path

Alright so i've been trying to change my controller path (so my project is more structured) but sadly everytime i try to route with the controller like so: Route::get('/', ['as' => 'home', 'uses' => 'PagesController@index']); Now that returns me a…
Rapthera
  • 43
  • 1
  • 3
4
votes
2 answers

Laravel controllers and routes in packages?

I'm having trouble registering controllers to routes in my package. As far as I understand from the official documentation I just need to simply prefix it and use my namespace though I always get the error of xyzclass not found. Anyone could explain…
peaks
  • 167
  • 2
  • 11
4
votes
1 answer

Laravel Route to multi domain

I'm creating a plataform to support multiple websites under the plataform, and some websites needs to have a different domain. The most commom is to use the same…
4
votes
2 answers

Laravel - Routes GET|HEAD

When I do php artisan routes, the GET request of my app has a |HEAD. What is the purpose of having |HEAD?…
cch
  • 3,336
  • 8
  • 33
  • 61
4
votes
3 answers

Laravel 4 Route::resource with multiple parameters

I am trying to have a REST design, but I am running in a bit of a problem. I have a resource schedule. Therefore, the normal notation of /schedules/{id} is not very applicable since I would like to have /schedules/{day}/{month}/{year} and then apply…
Kousha
  • 32,871
  • 51
  • 172
  • 296
4
votes
3 answers

The basics of php routing

I'm looking for a tutorial or explaination on how to do very basic php routing. For example when I visit a link like: mywebsite.com/users I want to run the get method of a route class to provide the data, in the same way laravel does…
Stephan-v
  • 19,255
  • 31
  • 115
  • 201
4
votes
2 answers

Laravel 4 remove /index on default getIndex controller function

Is it possible to remove /index on default getIndex restful controller function? Defined route for controller: Route::controller('registration', 'RegisterController', array( 'getIndex' => 'getRegister' )); Controller: class RegisterController…
Vlatko
  • 1,385
  • 1
  • 18
  • 35
4
votes
1 answer

Different session drivers depending on route in Laravel

I'm starting out with Laravel and was wondering if it's possible and relatively elegant to use a different session driver depending on the route requested. Ideally I'd like to share the functionality of my models between my main app and its…
schmoove
  • 493
  • 1
  • 4
  • 16
4
votes
3 answers

Named restful routes in Laravel 4

So, I've been able to get restful controllers working with Route::controller('users','UserController'); class UserController extends BaseController { public function getAccount(){} } and so /users/account works. However if I try to do…
Osan
  • 187
  • 1
  • 3
  • 13