laravel-routing

Laravel Datepicker And Eloquent Query

雨燕双飞 提交于 2019-12-13 05:17:05
问题 I am making a page where I can use the date ranger, datepicker from jqueryui.com and i am very mewbie to laravel Framework. I have the eloquent query as follows, public function orderbydate() { $order =DB::table('sales_flat_order_items as s') ->leftJoin('sales_flat_orders as w', 'w.entity_id','=','s.order_id') ->select(array(DB::Raw('sum(s.amount_refunded) as amount_refunded'), DB::Raw('sum(s.row_total) as row_total'), DB::Raw('sum(s.discount_amount) as discount_amount'), DB::Raw('sum(s.tax

Keep form values when redirect back in Laravel 4

China☆狼群 提交于 2019-12-12 11:51:15
问题 I'm trying to keep the values of a form when Redirect::back on Laravel 4, but I can't find a way to do this. This is my form: {{ Form::open(array('route' => 'generate', 'files' => true)) }} {{ Form::radio('myType', '1', true); }} {{ Form::label('myType', '1'); }} {{ Form::radio('myType', '2'); }} {{ Form::label('myType', '2'); }} {{ Form::radio('myType', '3'); }} {{ Form::label('myType', '3'); }} {{ Form::text('myName'); }} {{ Form::file('uploadImage'); }} {{ Form::submit('Go'); }} {{ Form:

Laravel MethodNotAllowedHttpException on POST form

只谈情不闲聊 提交于 2019-12-12 10:59:35
问题 I'm having an odd issue with a POST form in Laravel. When sending a post request, my Laravel throws an MethodNotAllowedHttpException. Upon looking into the errormessage, I can see that Laravel thinks that my request is a GET request, which it is not. When looking at both POST data and GET data of the errorpage, Laravel seems to think that they are both empty. This leaves me a bit confused, since it seems that some kind of redirect is going on, the HTTP_REFERER on the error is the page I'm

Laravel auth filter fails on production server

喜欢而已 提交于 2019-12-12 03:25:36
问题 I'm using Laravel 4 framework with standard built-in Auth support. In local environment everything works nice (MAMP, OSx), but on my production server (Digital Ocean standard image with Ubuntu, Apache, Php 5.5.9) auth filter fails and allows access without authentication. routes.php: Route::group(['before'=>'auth'], function(){ Route::get('admin', array('uses' => 'AdminController@home')); Route::get('admin/dashboard', function(){ return Redirect::to('admin'); }); Route::post('payment/ok',

My new route is causing an error and I need help finding it

有些话、适合烂在心里 提交于 2019-12-12 02:56:11
问题 So the error I am getting is Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException. Here is the route: Route::get('/', 'AuthController@index'); Route::get('/login', 'AuthController@login'); Route::post('/login', ['before' => 'csrf', 'uses' => 'AuthController@authenticate']); Route::get('/logout', 'AuthController@logout'); Route::group(['before' => 'auth'], function() { $noIndex = [ 'except' => ['index'] ]; $noShow = [ 'except' => ['show'] ]; Route::get('/dashboard',

Laravel 5.1 NotFoundHttpException in RouteCollection.php line 161:

你。 提交于 2019-12-12 02:52:13
问题 I get this error when I try to access delayTime method. I can't see what I am doing wrong. I have the routes setup like this: Route::post('quiz', [ 'as' => 'quiz', 'uses' => 'QuizController@create' ]); Route::get('quiz/token/{quizByToken}', [ 'as' => 'quiz.token', 'uses' => 'QuizController@getQuizByToken' ]); Route::get('quiz/code/{quizByCode}', [ 'as' => 'quiz.code', 'uses' => 'QuizController@getQuizByCode' ]); Route::get('quiz/id/{quiz}/players', [ 'as' => 'quiz.players', 'uses' =>

Laravel 4 Route Parameters for REST

匆匆过客 提交于 2019-12-12 01:58:15
问题 This might be a simple problem but I'm on testing with Laravel. I set my routes like this accordingly: // Users Route Route::get('users',array('as'=> 'users', 'uses'=> 'UsersController@index')); Route::get('users/{id}', array('as' => 'user', 'uses' => 'UsersController@show') ); Route::get('users/{id}/edit', array('as' => 'edit_user', 'uses' => 'UsersController@edit') ); Route::get('users/new', array('as' => 'new_user', 'uses' => 'UsersController@create')); Route::post('users',

Use js function variable in route

ⅰ亾dé卋堺 提交于 2019-12-12 01:46:19
问题 I want to pass ID to my route via ajax but cant do that: function test(id){ $('#items').DataTable({ ajax: { url: '{!! route('routename', ['menu_id' => id]) !!}', type: 'POST' }, It says Use of undefined constant id. How can i use javascript variables to pass through route? 回答1: It is not possible to use javascript variables in PHP as server side code is executed before client side code. So you may assign JS variables to equal PHP variables but not the other way around. Check this out: https:/

Passing input (form) from a page to itself

梦想与她 提交于 2019-12-12 00:58:11
问题 I am working on my first laravel script, trying to submit a form and see the input on the same page. I am working on this problem for days, hopefully someone can solve this. The problem is that i get this error: Undefined variable: data (View: D:\Programmer\wamp\www\laravel\app\views\bassengweb.blade.php) view: Bassengweb.blade.index @extends('master') @section('container') <h1>BassengWeb testrun</h1> <table> {{ Form::open(array('route' => 'bassengweb', 'url' => '/', 'method' => 'post')) }}

Laravel 5.2 route model binding

◇◆丶佛笑我妖孽 提交于 2019-12-11 23:35:26
问题 Laravel has a documentation regarding route model binding which could be found here. But there is no example with regards to this kind of scenario: Route::get('search/', 'ArticleController@search'); How to I implicitly bind a model into the route? I know I could do something like this directly on the controller's method. public function search(Model $model) { // some code here } But I'm just curious on how to do it on the routes instead. I am after this approach Route::get('search/{article}',