laravel-routing

Laravel 4 how get routes by group name

做~自己de王妃 提交于 2019-12-11 08:32:24
问题 In Laravel, I know I can get all routes using `Route::getRoutes() but I can't find if it is possible to get a list of all routes contained in a specified group. For example, i have this route file: Route::group(array('group_name' => 'pages'), function() { Route::any('/authentication', array('as' => 'authentication', 'uses' => 'LogController@authForm' )); Route::group(array('before' => 'auth_administration'), function() { Route::any('/tags_category/index', array('as' => 'index-tags-categories'

Laravel routing group for muliple domains with wildcards, how to handle domain suffixes?

回眸只為那壹抹淺笑 提交于 2019-12-11 08:28:02
问题 I have 3 domains which, on my local server, take the format: mydomainfirst.local mydomainsecond.local mydomainthird.local In my routes.php file, I have the following: Route::group(array('domain' => '{domain}.{suffix}'), function() { Route::get('/', 'Primary@initialize'); }); The idea is to take the $domain variable in my controller and extract the first/second/third part from it, which works fine. However, now my site is online, this routing file no longer works and throws a Http-not-found

Laravel rename routing resource path names

最后都变了- 提交于 2019-12-11 07:51:47
问题 Can we rename routing resource path names in Laravel like in Ruby on Rails? Current /users/create -> UsersController@create /users/3/edit -> UsersController@edit .. I want like this; /users/yeni -> UsersController@create /users/3/duzenle -> UsersController@edit I want to do this for localization. Example from Ruby on Rails; scope(path_names: { new: "ekle" }) do resources :users end 回答1: I know this is an old question. I'm just posting this answer for historical purposes: Laravel now has the

Routing between Angular & Laravel

烂漫一生 提交于 2019-12-11 05:49:33
问题 I am trying to make a simple App in Angular , integration with Laravel 5 and facing issues while routing the application views. Routes.php looks like as below: <?php Route::get('/', function () { return view('index'); }); in Routes.php, i am handling only first time when application loads. But after that i want to handle all routing by Angular. So, i did like this: app.js file var membershipModule = angular.module('membershipModule', ['ngMaterial','ngRoute']); membershipModule.config(function

Post to Laravel 5 from 3rd party API

我与影子孤独终老i 提交于 2019-12-11 05:23:17
问题 I'm using Laravel 5 to build a basic app. I'm using a third party SMS gateway which takes an SMS and POST the results to my app. I'm testing it locally using Postman for Chrome, and Requestb.in My Problem: When I try to POST to my app, I get a "whoops" error from Laravel, status code 405. My Hunch: I have a feeling this is because of default CSRF failing. The request is coming from outside of my app's ecosystem. In my routes I have: Route::post('/sms/', 'SMSController@create'); SMSController:

How could I use one route with git for multiple developers in Laravel 4.2

放肆的年华 提交于 2019-12-11 03:12:30
问题 I have only one routes app/routes.php , I am using git /git-hub for sharing my projects with some developers. Cause they can work together. But problem is that : every one using same routes.php file for routing and when they push/pull in git this routes.php file conflicts all the time. Is there any way to set routes for different developer in same project ? 回答1: There is a silly way but fruitful:: create routes_demo.php :: here demo developer can work Include routes_demo.php in your main

Route::redirect with wildcard in Laravel 5.5+

拜拜、爱过 提交于 2019-12-11 00:45:32
问题 The new Route::redirect introduced in Laravel 5.5 is practical, but does it allow {any} wildcard? Here is what I used to do in Laravel 5.4 Route::get('slug', function () { return redirect('new-slug', 301); }); In Laravel 5.5, I can do the following: Route::redirect('slug', url('new-slug'), 301); Which allows route caching by getting rid of the closure. So far so good , but what if I want to use a wildcard? In Laravel 5.4, I could do: Route::get('slug/{any}', function ($any) { return redirect(

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

微笑、不失礼 提交于 2019-12-10 21:04:16
问题 This question already has answers here : Logout: GET or POST? (9 answers) Closed 3 years ago . 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 : <ul class="dropdown-menu" role="menu"> <li> <a href="{{ url('/logout') }}" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">

Laravel Exception 405 MethodNotAllowed

社会主义新天地 提交于 2019-12-10 19:52:17
问题 I'm trying to create a new "Airborne" test in my program and getting a 405 MethodNotAllowed Exception. Routes Route::post('/testing/{id}/airbornes/create', [ 'uses' => 'AirborneController@create' ]); Controller public function create(Request $request, $id) { $airborne = new Airborne; $newairborne = $airborne->newAirborne($request, $id); return redirect('/testing/' . $id . '/airbornes/' . $newairborne)->with(['id' => $id, 'airborneid' => $newairborne]); } View <form class="sisform" role="form"

Remove index.php from url Laravel 5

无人久伴 提交于 2019-12-10 19:37:51
问题 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 sitemap for one page. One page without index.php and another with index.php . Demonstration of the sitemap is here https://www.xml-sitemaps.com/details-eln.6762418.html Here is the .htaccess <IfModule mod_rewrite.c> <IfModule mod_negotiation.c>