Questions tagged [laravel-request]

Laravel Requests - handling request and Request validation

218 questions
1
vote
3 answers

Laravel redirect after update uses PUT request

I have Laravel app with Vue on front end, and Vue calls update method from controller using PUT request. Request works, model gets updated, but I have issue with redirecting as it is redirecting also as a PUT instead of simple GET? public function…
Norgul
  • 4,613
  • 13
  • 61
  • 144
1
vote
0 answers

Laravel Request :BadMethodCallException Method getPath does not exist

I was trying to add some validation in Request ,I get "BadMethodCallException Method getPath does not exist" error. I am sending just null value in postman to test it. for example: { "name":null } Here is my controller: namespace…
user3810794
  • 263
  • 2
  • 6
  • 23
1
vote
1 answer

How to verify session and auth token in Vue 2 and Laravel 5.5

I have a project structure like client folder and server folder. Within client folder I have full Vue 2 project template using vue-admin-lte. Front end is working perfectly but where I am stuck is I need to authenticate each and every request to…
Debarun Pal
  • 113
  • 11
1
vote
1 answer

laravel custom request edit unique

i have custom request on laravel 5.5 this is the request public function rules() { if($this->method() == 'POST') { return [ 'user_name' => 'required|unique:users|max:40|min:1', 'user_email' =>…
Awar Pulldozer
  • 1,071
  • 6
  • 23
  • 40
1
vote
1 answer

How to validate Solar Hijri (SH) date In Php / Laravel

I have birthday field in my form.and type is date string (picked by date picker). I validate this request by 'birthday'=>'required|date_format:"d/m/Y"|after:"01-01-1396"', But in Solar Hijri calendar we have date like 31/06/1396 and the validator…
amin saffar
  • 1,953
  • 3
  • 22
  • 34
1
vote
5 answers

Laravel Redirect If Authenticated middleware

I have three type of users for the application, Each one have its own dashboard. I need a check that adminor any other user cannot see another user dashboard. There is a middleware RedirectIfAuthenticated : public function handle($request, Closure…
Gammer
  • 5,453
  • 20
  • 78
  • 121
1
vote
3 answers

laravel 5.5 FormRequest class is redirecting to me i need send array errors response

I have a problem when i validate a request with a FormRequest extended class. Because is redirecting when a bad request is recived and i need a response with the validation errors. I'm using: PHP 7.1.1 (cli) (built: Jan 18 2017 18:51:14) ( ZTS…
1
vote
1 answer

Laravel 5.3 custom validation messages array

I'm using Laravel 5.3 and i try to set a custom message for every string with max length inside the Request Class like ...
1
vote
1 answer

How to replace nested array value inside the Laravel request using merge?

There is a function to replace the input from the request which is called merge. I would like to change a value of a nested array so that it can be validated by $this->validate method.. This is the output of $request->all() array:2 [ "type" =>…
Brian Ruchiadi
  • 331
  • 1
  • 13
  • 29
1
vote
0 answers

Laravel 5.3: Form Validation does not show errors

I am trying to create a register form using Laravel. I created a request \App\Http\Requests\RegisterNewUserRequest. This is the rules() method: public function rules() { return [ 'email' => 'required|email|min:6|max:255|unique:members', …
zkanoca
  • 9,664
  • 9
  • 50
  • 94
1
vote
0 answers

Laravel 5. How to create a register using tables : users,profile and account

i'm trying to create a system of register and authentication using three tables. Users, Account and Profile. But when attempting to use a registration form displays the following message below:Tables Column not found: 1054 Unknown column 'email' in…
1
vote
1 answer

how I can make date control (after date - before date) in laravel 5

Hi I want to make after date-before date control that is using request validation in laravel. So, starting date should not be more than end date. how can do this. I would appreciate if you could help me. public function rules() { return [ …
onerciller
  • 760
  • 1
  • 8
  • 13
1
vote
2 answers

how to use validation rules exists for image upload field in Laravel 5

I use Laravel 5 in Update,Create Request files public function rules() { return [ 'image' => 'required', 'description' => 'required', 'link' => 'required', ]; } but update request needs change image rule because…
Amir Hosseinzadeh
  • 7,360
  • 4
  • 18
  • 33
1
vote
1 answer

Laravel - Path of page from which request was made

How can I determine the path of the page from which the request was made? I have tried $request->path() or Request::path() but these two return the path on which request is going..
Hassan Saqib
  • 2,597
  • 7
  • 28
  • 51
1
vote
1 answer

Laravel validation 'unique' not working as expected

I'm developing a Help Centre for a site and I've asked the question over at the Laracast Forums to which I haven't had a solution from yet unfortunately, here us the routes/url paths for it: routes.php Route::resource('admin/help-centre/category',…
no.
  • 2,356
  • 3
  • 27
  • 42