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

Set the protocol on a Laravel route

I have a route on the site that is to a webcal resource so we would like the URL to be generated with webcal:// when using {{ URL::route('calendar') }} in the Blade template. I tried adding a protocol option but this is ignored, so I guess there…
Space
  • 2,022
  • 1
  • 19
  • 29
4
votes
1 answer

Laravel route cache on custom route files

I'm building a project in Laravel 5.2 which had a big (big as in a lot of lines) routes.php. To make the routes a little cleaner for the eyes, I've split all the route groups intro separated files. In app\Http\Routes\. I require all the files in the…
Dees Oomens
  • 4,554
  • 3
  • 29
  • 61
4
votes
0 answers

Use Laravel Spark's Controllers/Actions in my app's API

I'm up and running with Laravel Spark, but I'd like to pull some of the user auth methods (and later, some others) in to my API. Spark's default registration method is a POST request to /register that calls Auth\RegisterController@register. I would…
brianrhea
  • 3,674
  • 3
  • 34
  • 57
4
votes
3 answers

Laravel 5 Multiple Download File

This code will work correctly if I open browser at 127.0.0.1/load/files. (Auto Download File) ABCController.php namespace App\Http\Controllers; use Response; use File; function download_file(){ return Response::download(public_path() .…
Thailand Love U
  • 79
  • 1
  • 1
  • 7
4
votes
1 answer

How to return two views from One Function in Laravel 5.2

My question is little hard to explain but I will try to elaborate it cleanly. I have a StoreController which includes single show($id) function used to display single page product data. This function has one return statement which is ( return…
user6060368
4
votes
1 answer

Laravel 5: Handling Dynamic and Static routes

Is there a way in Laravel5 where I could define routes that handles dynamic routes without conflicting with current static routes? Something similar below: // Dynamic routes Route::get('{permalink}', function($permalink) { //look for matching…
Jhourlad Estrella
  • 3,545
  • 4
  • 37
  • 66
4
votes
1 answer

Laravel Elfinder redirecting to homepage while using 'auth' middleware

I am using https://github.com/barryvdh/laravel-elfinder and whenever i set middleware to auth in config/elfinder.php file , I am redirected to home page, but whene i use middleware to NULL , elfinder opens perfectly fine. How can i secure the route…
John Cargo
  • 1,839
  • 2
  • 29
  • 59
4
votes
2 answers

Setup route in Laravel 5 for CKEditor to work with CKFinder

Hello i am trying to integrate the CKFinder with CKEditor in a laravel project. I have made following settings in my config.js file of CKEditor: CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. For…
user3201500
  • 1,538
  • 3
  • 22
  • 43
4
votes
1 answer

Laravel: Using minimal nested routes with controllers

I'm using Laravel 5.2 to create a REST API, and I'm trying to follow the best practices for API design, documented here. One of the points mentions minimising path nesting, like so: In data models with nested parent/child resource relationships,…
SteveEdson
  • 2,485
  • 2
  • 28
  • 46
4
votes
2 answers

Laravel 5.1 ACL route resource not working

After following a tutorial on how the built-in acl of laravel works I tried it and it works well by defining every route by itself. Now I'm trying to use a resource but it's not working as intended. I added the following code to my routes…
davejal
  • 6,009
  • 10
  • 39
  • 82
4
votes
2 answers

How to move my controllers into a separate package folder in Laravel 5.2?

I build a small app using laravel 5.2. I put all of my files into a folder called Surveys located at App/Modules/Surveys. "No worries, I am planning to move the Modules out of the App folder, I just need to get the controller to work" Currently my…
Junior
  • 11,602
  • 27
  • 106
  • 212
4
votes
5 answers

How to pass default parameters to laravel controller in a get route

I have a route like that: Route::get('category/{id}/{date?}', array('as' => 'category/date', 'uses' => 'Controller@getCategory')); I want to run @getCategory with default parameters when called '/' root route. So if '/' route called, getCategory…
horse
  • 707
  • 4
  • 11
  • 30
4
votes
1 answer

Laravel 4.2 application occurs unnecessary redirection after uploading live server

My laravel(4.2) application is working fine on localhost(xampp). But after uploading into live server when trying to login, it is showing a blank page with a message saying "redirecting to my home url". It also throws a login error Sorry for my weak…
Bappa sarkar
  • 326
  • 3
  • 16
4
votes
1 answer

Laravel 5 Cashier Middleware Routing Error

I've implemented the cashier / billing feature from Laravel 5 and I'm trying to protect a group of routes using middleware which checks for a subscription. I'm getting the following error: Argument 2 passed to…
Dev.W
  • 2,340
  • 9
  • 38
  • 77
4
votes
1 answer

Laravel route works perfectly locally but not on remote. (Dingo Api)

I am using dingo/api for a project and all of my routes work other than 1. routes.php $api = app('api.router'); $api->version('v1',['prefix' => 'api'], function ($api) { $api->post('users',…
Bharat Geleda
  • 2,692
  • 1
  • 23
  • 31