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
4 answers

laravel 4: difference between resource and controller in Route class

what is the difference between static Route methods "resource" and "controller" Route::controller() and Route::resource() thanks,
mwafi
  • 3,946
  • 8
  • 56
  • 83
6
votes
2 answers

Pass many optional parameters to route in Laravel 4

I need to built URLs like this: http://www.example.com/param1/param2/param3/.../paramN in a search page, user searchs by any possible options so making a URL like it in Laravel would be like…
Pars
  • 4,932
  • 10
  • 50
  • 88
6
votes
3 answers

Laravel case insensitive routes

How do I define a case insensitive (part of a) route? Example: Route::get('/{userId}/profile'); http://domain.com/123/profile works fine. Any use of uppercase in the fixed part of the route does not work: http://domain.com/123/Profile does not…
preyz
  • 3,029
  • 5
  • 29
  • 36
6
votes
1 answer

How to extend Laravel Blade functionality and add 'break' and 'continue' support

I would like to add @continue and @break statements for my Blade engine in order to control my loops. I've seen into the sources an extend function for the BladeEngine, and I've tried to use it in my routes.php file: Blade::extend(function ($value)…
Fractaliste
  • 5,777
  • 11
  • 42
  • 86
6
votes
2 answers

Laravel 4, delete image within a post method / possible?

I am trying to delete an old user image, if the user updates his profile picture. I am using Laravel 4.1 and a resourceful UsersController. Updating the picture works perfectly fine. A new one is saved in my folder and the file nave is overwritten…
patrick
  • 881
  • 2
  • 9
  • 32
6
votes
2 answers

Laravel 4 authentication. Restrict access to some functions of a resource but not all

I have this blog resource which has the usual CRUD methods.(index, create, store, show, edit, update, destroy). I have the following route in my routes.php: Route::resource('blog', 'PostsController'); but I want to restrict all but index and…
Ben Dubuisson
  • 727
  • 13
  • 38
6
votes
3 answers

Laravel 4 : Route to localhost/controller/action

I'm more or less new to Laravel 4. I've never used routes before but normally what I'm used to is url/controller/action and then the backend routing for me. I've read the documentation for routes and controllers a few times as well as read through…
samuraiseoul
  • 2,888
  • 9
  • 45
  • 65
5
votes
7 answers

Laravel Target class [App\Http\Controllers\App\Http\Controllers\ApiController] does not exist

For some reason, which is probably my fault, Laravel thinks it should be looking for the class ApiController in path: 'App\Http\Controllers\App\Http\Controllers', so... it doubles, but I have no idea why. It's a brand new Laravel 6 project, I've…
Serellyn
  • 405
  • 1
  • 9
  • 26
5
votes
3 answers

How to pass Query parameter using route name in laravel?

I know this one {{route('editApplication', ['id' => $application->id])}} == /application/edit/{id} But I need ?? == /application/edit?appId=id Anyone, please replace the "??" with your answer that helps me out.
Md. Robi Ullah
  • 1,703
  • 3
  • 20
  • 32
5
votes
4 answers

how to pass different dynamic parameters at same position to access different view pages in laravel

These are my routes for which I am facing problem Route to get the list of registered places in a particular city Ex: http://localhost:8000/London, http://localhost:8000/London/Restaurants Route::group(['namespace' => 'Page'], function() { …
Prateek
  • 1,229
  • 17
  • 31
5
votes
2 answers

Is it possible to create a second Laravel "api route" with a separate API KEY?

I'm new to Laravel and I am handed an existing application that is composed of two parts: 1 - An admin backend built on Laravel and uses Vueify 2 - The frontend website built on next.js and uses react components The admin part communicates with…
frezq
  • 653
  • 8
  • 18
5
votes
2 answers

Laravel resource route delete from axios

I would like to setup axios to delete a record using a resource route: axios.delete('/job-management', this.deletedata).then((res)=>{ console.log(res); }) For my routes I have: Route::resource('job-management', "PositionsController", [ 'as' =>…
Geoff
  • 6,277
  • 23
  • 87
  • 197
5
votes
1 answer

Two slashes in url with optional parameters in Laravel 5

I want to create Users`s shop in my application. Default urls are: site.com/cars site.com/parts If user create own shop urls viewed like this: site.com/user_name/cars site.com/user_name/parts And if user do not create store, parameter {user_name}…
halenharper
  • 88
  • 1
  • 8
5
votes
1 answer

Why does Laravel, by default, logout via POST (As opposed to GET)?

Within the context of a Laravel application, what is the significance of POSTing to perform a logout? Is there some security and/or session particularity that POSTing over just GETing? The relevant portion from the generated make::auth:
Chris
  • 54,599
  • 30
  • 149
  • 186
5
votes
1 answer

how to exclude certain views with laravel view composer

How can I make sure that I load data via view composer for select views and only exclude a few, two views to be specific? Can i use a regex instead of '*'? public function boot() { view()->composer( '*', …
Chiko
  • 2,330
  • 4
  • 21
  • 29