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
6
votes
2 answers

Is there a way to use Laravel api throttle on individual method inside a controller?

I am using api throttle in my routes/api.php (as you can see in the code) but I am wondering if I can use it in the controller on methods. Route::resource('/user/{user}/post', 'UserPostController')->middleware(['auth:api', 'throttle:5,1']);
6
votes
2 answers

Laravel fails to find route except when the route is named

I'm trying to implement a basic authentication system using only the built-in Laravel features. The system works but only if I assign a name to the /admin/login route [i.e ...->name('admin.login)]. If I take it out, the exception I get is the…
uhexos
  • 383
  • 4
  • 19
6
votes
3 answers

Apply Auth Middleware to All Laravel Routes

What is the correct way to authenticate all routes except login and register when I apply auth middleware in all controllers? Is there a way to apply auth middleware in one place and exclude login, register routes?
user3351236
  • 2,488
  • 10
  • 29
  • 52
6
votes
2 answers

How to use multiple method in single route in laravel

I want to use more than one method in a single route using laravel. I'm try this way but when i dd() it's show the plan string. Route::get('/user',[ 'uses' => 'AppController@user', 'as' => 'useraccess', 'roles'=> 'HomeController@useroles',…
Gabrielle-M
  • 1,037
  • 4
  • 17
  • 39
6
votes
3 answers

Laravel 5.3 Route model binding with multiple parameters

Is it possible to have route model binding using multiple parameters? For example Web Routes: Route::get('{color}/{slug}','Products@page'); So url www.mysite.com/blue/shoe will be binded to shoe Model, which has color blue.
Fusion
  • 5,046
  • 5
  • 42
  • 51
6
votes
2 answers

Laravel POST call returns index() function instead of store()

I'm writing my first app in laravel, it's really nice environment for new laravel developers. To shorten the story: I've created two eloquent models via php artisan commands and created corresponding controllers the same way. One of those is…
D. Look
  • 111
  • 2
  • 11
6
votes
3 answers

Laravel resource: How define the name of the key parameter?

When you define a resource with Route::resource('recipe', 'RecipeController');, among others, the following route is defined: /photo/{photo}/edit, and once you define all your resources you have something like…
olvlvl
  • 2,396
  • 1
  • 22
  • 22
6
votes
2 answers

HTTPException in Laravel artisan route list

I am having a problem that running php artisan route:list is throwing a Symfony\Component\HttpKernel\Exception\HttpException but it is not giving me any other output or logging it anywhere I can see. I have tried composer update and dump-autoload as…
rosscooper
  • 1,976
  • 3
  • 16
  • 29
6
votes
2 answers

Is there a way to exclude a route from CSRF protection from within a package in Laravel 5?

I am aware of the $except property of the VerifyCsrfToken middleware (app/Http/Middleware/VerifyCsrfToken.php) but I am looking for a way to do something similar from my package (so the users who install it don't have to modify their…
Julio J.
  • 193
  • 1
  • 5
6
votes
2 answers

Laravel Form Action Url

I don't know how to send datas (in POST) to another site than mine with Laravel Form. I tried a (GET) form : {!! Form::open(array('url' => 'http://other.domain.com')) !!}
6
votes
2 answers

How not to overload main routes with package routes?

Main App Routes: Route::get('/login', [ 'as' => 'user.login', 'uses' => 'LoginController@login' ]; Route::get('/logout', [ 'as' => 'user.logout', 'uses' => 'LoginController@logout' ]; Route::get('/admin', [ 'as' =>…
Metra
  • 393
  • 5
  • 20
6
votes
7 answers

Laravel 5 Routing Object Not Found

I ussualy using Laravel 4 and now Im trying to learn Laravel 5 there's problem on Naming Controller Routes : i had route like : Route::get('/', [ 'uses' => 'HomeController@viewHome', 'as' => 'home' ]); Route::get('/events', [ …
GandhyOnly
  • 325
  • 2
  • 5
  • 18
6
votes
3 answers

Temporarily disable / bypass Middleware

In my Application I implemented a OAuth2-Server (oauth2-server-laravel) in combination with a custom Authentication Package (Sentinel by Cartalyst). In my routes.php: Route::group(['before' => 'oauth'], function() { // ... some routes here } So…
rookian
  • 1,045
  • 14
  • 38
6
votes
3 answers

Laravel RESTful returning 301 state

Mates, I'm developing a Backbone/Laravel application. When I try to send a POST request to a certain resource, it returns me 301 status with no response, regardless that on the controller i'm printing a 'hello world', to check if it's getting to…
Pablo
  • 1,173
  • 4
  • 18
  • 46
6
votes
2 answers

Laravel - Add trailing slash with Redirect::route()

I'm trying to add a slash to the end of the URL after I use Redirect::route() with Laravel. I've tried numerous examples but couldnt find an answer. This is what I have so far: routes.php: Route::get('/', function() { return…
user3685965
  • 61
  • 1
  • 3