laravel-form

Laravel request validation with multiple forms on the same page

血红的双手。 提交于 2020-01-24 07:49:32
问题 I have three different forms on the same page. All inputs has it's own validation rules, code in Request file has structure like this: public function rules() { return [ // 'sold' => 'required', 'unit_in_stock' => 'required', 'unit_price_gbp' => 'required', 'returned_item' => 'required', ]; } public function messages() { return [ 'sold.required' => 'Please enter quantity of sold parts', 'unit_in_stock.required' => 'Please enter quantity of sold parts', 'unit_price_gbp.required' => 'Please

Laravel request validation with multiple forms on the same page

半腔热情 提交于 2020-01-24 07:49:09
问题 I have three different forms on the same page. All inputs has it's own validation rules, code in Request file has structure like this: public function rules() { return [ // 'sold' => 'required', 'unit_in_stock' => 'required', 'unit_price_gbp' => 'required', 'returned_item' => 'required', ]; } public function messages() { return [ 'sold.required' => 'Please enter quantity of sold parts', 'unit_in_stock.required' => 'Please enter quantity of sold parts', 'unit_price_gbp.required' => 'Please

Using multidimensional array input names with Laravel 4.2 Form facade throws error on postback

杀马特。学长 韩版系。学妹 提交于 2019-12-23 01:13:14
问题 I'm having an issue in Laravel 4.2 with the Form facade when using input names that represent multidimensional arrays. The form will load, display, and post data correctly unless there are values set in Input::old() (because of failed validation, etc.). Here is a simple example that shows the problem: routes.php: Route::get('input-test', function() { return View::make('input_test.index'); }); Route::post('input-test', function() { return Redirect::back()->withInput(Input::all()); }); input

post request not working Laravel 5

落爺英雄遲暮 提交于 2019-12-17 21:18:47
问题 I am trying to submit a form using post method, but it does not seem to be working. I have enabled error debug on but still no error is shown. After submitting the form the same page is loaded without any errors. This is my route Route::post('/home' , ['as' => 'store-post' , 'uses'=>'FacebookControllers\PostsController@save']); And my form is {!! Form::open(['route'=>'store-post' , 'class'=>'form'])!!} <div class="form-group"> <label for="textarea"></label> <textarea class="form-control" rows

Form error htmlentities() expects parameter 1 to be string, array given and no line

余生长醉 提交于 2019-12-13 08:17:44
问题 If I change the error to simple HTML, the error is gone. {{Form::open(array('url'=>'')) . "" }} <div class="basic-form"> and it goes on: (cannot paste more code here) <div class="hsb-input-1"> {{Form::text('user_query', array('class'=>'form-control', 'placeholder'=>'I\'m looking for qualified personnel in ...')) }} </div> <div class="hsb-text-1">Language</div> <div class="hsb-container"> <div class="hsb-select"> {{Form::select('selection', ['all'=> 'Select all', 'c' => 'C/C++/C#', 'html' =>

Laravel 5: Installing Form and HTML classes without composer

跟風遠走 提交于 2019-12-10 21:18:49
问题 I'm interested in installing Form and HTML classes on Laravel 5 without composer. How can I do this? For those wanting to convince me to use composer: 1) I want to see what it does by doing it manually myself at least once. 2) There is no composer on my hosting. 3) Using composer.phar throws an error: Script php artisan clear-compiled handling the pre-update-cmd event returned with an error , gives a warning: Warning: Composer should be invoked via the CLI version of PHP, not the cgi-fcgi

Using multidimensional array input names with Laravel 4.2 Form facade throws error on postback

旧巷老猫 提交于 2019-12-06 15:01:39
I'm having an issue in Laravel 4.2 with the Form facade when using input names that represent multidimensional arrays. The form will load, display, and post data correctly unless there are values set in Input::old() (because of failed validation, etc.). Here is a simple example that shows the problem: routes.php: Route::get('input-test', function() { return View::make('input_test.index'); }); Route::post('input-test', function() { return Redirect::back()->withInput(Input::all()); }); input_test/index.blade.php: <!doctype html> <html> <head> <title>Input Array Test</title> </head> <body> {{

Laravel: HTTPS in Form::open()

允我心安 提交于 2019-11-30 09:33:10
I'm using SSL for my website (Cloudflare HTTPS) in my login for weh I use ``, Laravel won't convert my website link to SSL version and it shows http version. How can I force Laravel to use https for me? For example: <?=Form::open(array('id' =>'submit'))?> . . . <?=Form::close()?> And the result will be: <form method="POST" action="http://example.com" accept-charset="UTF-8" id="submit"> </form> I want action to be a HTTPS link. If you want to use https you need to manually give path which will be set to action. You need to use URL::to this way: <?=Form::open(array('url' => URL::to('/', array(),

Laravel: HTTPS in Form::open()

北战南征 提交于 2019-11-29 14:29:08
问题 I'm using SSL for my website (Cloudflare HTTPS) in my login for weh I use ``, Laravel won't convert my website link to SSL version and it shows http version. How can I force Laravel to use https for me? For example: <?=Form::open(array('id' =>'submit'))?> . . . <?=Form::close()?> And the result will be: <form method="POST" action="http://example.com" accept-charset="UTF-8" id="submit"> </form> I want action to be a HTTPS link. 回答1: If you want to use https you need to manually give path which

post request not working Laravel 5

北城以北 提交于 2019-11-28 14:41:59
I am trying to submit a form using post method, but it does not seem to be working. I have enabled error debug on but still no error is shown. After submitting the form the same page is loaded without any errors. This is my route Route::post('/home' , ['as' => 'store-post' , 'uses'=>'FacebookControllers\PostsController@save']); And my form is {!! Form::open(['route'=>'store-post' , 'class'=>'form'])!!} <div class="form-group"> <label for="textarea"></label> <textarea class="form-control" rows="5" name="textarea">What's on your mind?</textarea> </div> <div class="form-group col-sm-12"> <input