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 routing - custom domain for same routes

Say I have theese routes: http://mylaravelapp.com/{slug} http://mylaravelapp.com/{slug}/page http://mylaravelapp.com/{slug}/another/{custom_slug} And I would like the same routes to be accessed from a custom domain, pointing to my laravel app's IP.…
FooBar
  • 5,752
  • 10
  • 44
  • 93
4
votes
3 answers

Laravel 5.1 routing not working except '/'

I have created a new laravel project in /var/www/polyforms.me and created virtual host file polyforms.conf: ServerName polyforms.dev ServerAdmin webmaster@localhost DocumentRoot /var/www/polyforms.me/public …
clzola
  • 1,925
  • 3
  • 30
  • 49
4
votes
3 answers

fix laravel 5 session expiring after refresh or going on another page?

I'm using laravel default Auth. When I login into my website all works great. When I try to refresh or go to another page (still using Auth middleware) my session is expired, I'm directly logged-out and I must login again. How can I fix this so I…
4
votes
1 answer

Remove index.php from url Laravel 5

URLs are working fine in my application. I mean they are pretty URLs. Like http://www.example.com/ But it also works when you access the page with index.php like http://www.example.com/index.php, which I don't want because it is showing two links in…
Jamal Abdul Nasir
  • 2,557
  • 5
  • 28
  • 47
4
votes
1 answer

Laravel 5 Routing Calling Wrong View

I've got a simple Laravel 5 site that I am working on (learning Laravel) I have a link on my 'users' view to add a 'new user': Create New User My user Routes look like the following: Route::get('/users',…
Hanny
  • 2,078
  • 6
  • 24
  • 52
4
votes
2 answers

Laravel 5 ModelNotFoundException in Builder.php for Routing

I have a Model Class with name Article.php and use below rout: Route::get('articles/create','ArticlesController@create'); when input in browser http://localhost:8000/articles/create i see this error : ModelNotFoundException in Builder.php line 125:…
4
votes
1 answer

Laravel Image thumb

I making a web app where uploaded photos are stored in /app/storage. To show the file I am using a route ex: showphoto/{id} (Paths are stored in DB) public function showphoto($id){ $photo = Photo::findOrFail($id); return…
SergkeiM
  • 3,934
  • 6
  • 36
  • 69
4
votes
2 answers

Laravel form requests and validation

Below is my solution for using the one form validation request for the create/store and edit/update methods on a controller (Laravel 5). It is a cumbersome and ugly hack (i.e. it reads the URI segments to get the id of the record being edited). Is…
4
votes
2 answers

Laravel 5 multilanguage support

I am new to laravel and i am trying to support my application with mutilanguage. I have downloaded the default Login System for laravel 5 and integrated the multisupport language tutorial from below…
Faisal Ahsan
  • 928
  • 1
  • 12
  • 22
4
votes
3 answers

why cannot find composer.phar file after install composer

I try to install composer with the installer for Windows , but could not be installed globally. The message: Could not open input file: c:\windows\system32\composer.phar I have to run on the following url: C:\ProgramData\ComposerSetup\bin; My…
Leoh
  • 642
  • 2
  • 17
  • 41
4
votes
1 answer

difference between laravel get and post route

I am a beginner in laravel i am shifting from codeigniter to laravel so i dont have the concepts of routes.Can any one tell me what is the difference between a post and get route in laravel 5. Basic GET Route Route::get('/', function() { return…
user2166164
4
votes
1 answer

Laravel multiple route aliases

I'm trying to create a route with an array of aliases, so when I call whois or who_is in the url it goes to the same route. Then I don't need to keep repeating the code every time, changing only the alias. I tried the code below. Variables in the…
Michel Ayres
  • 5,891
  • 10
  • 63
  • 97
4
votes
3 answers

How to set regular expression parameter constraints for Route::group in Laravel 4?

For simple routes I know I can user where statement. But what about parameters in Route::group() prefix where('id', '[0-9]+'); Route::group(['prefix' => 'foo/{bar}'], function() { //…
Behzadsh
  • 851
  • 1
  • 14
  • 30
4
votes
2 answers

Laravel route doesn't get to the controller

My project was working just fine till few hours ago. Some routes still working and some stopped. I tried to delete the new modification I made but the problem persists!!!!! For example, this route used to go to index() method at the guest controller…
Dr. MAF
  • 1,853
  • 1
  • 27
  • 45
4
votes
0 answers

Laravel - CURL test to API works on localhost, but not on live website

I am struggling to access my Laravel API on the production server. The development server (localhost) works fine. On my localhost, I am using: curl -X POST -d…
user860511