Questions tagged [laravel-validation]

This tag references different approaches to validate your application's incoming data using Laravel.

Laravel provides several different approaches to validate your application's incoming data. By default, Laravel's base controller class uses a ValidatesRequests trait which provides a convenient method to validate incoming HTTP request with a variety of powerful validation rules.

Read More

852 questions
-1
votes
3 answers

Confused about Laravel "sometimes" validation works

I'm really confused about why this is happening? I had successfully added a record then when I tried to update the record It says that the field is required even I passing it already. Then when I tried to add "sometimes" on the validation. Now, it…
-1
votes
3 answers

Custom Rule class in Laravel - how to get message working?

Working on an existing project, so keeping the code structure the same as other developers is critical. I've created a new Rule and added my Validator::extend to the boot(). However I can't get the validation error to display my custom message.…
-1
votes
1 answer

How to write custom validation message for multiple inputs in a laravel form?

$validation = $request->validate([ 'title'=>'required', 'description'=>'required', 'type'=>'required', 'building_plot_size'=>'required', 'parking'=>'required', …
-1
votes
1 answer

error messge output not displaying correctly

could someone show me how to get the :other or :after_field to display in the error message. $messages = ["after_field" => "The :attribute must be greater than the :other."]; validation rule: $rules = ['sale_end' =>…
ONYX
  • 5,679
  • 15
  • 83
  • 146
-1
votes
2 answers

Do custom error messages in Laravel 4.2

I'm new in Larvel 4.2 here! How do I do a custom error messages in Laravel 4.2? And where do I put these codes? I've been using the defaults and I kind of wanted to use my own.
BourneShady
  • 955
  • 2
  • 17
  • 36
-2
votes
1 answer

Laravel 9 Validator Make Method Not Working

I have written this code in the Controller as the Action of a form: public function submitAsk(Request $request) { $rules = [ 'title' => 'required|max:255', 'description' => 'required|max:1000', …
Pouya
  • 114
  • 1
  • 8
  • 36
-2
votes
2 answers

How to show only one error message from Laravel request rules

I am using Laravel request to validate in my controller the requested data and here is my request file data I am facing two challanges first I am not able to return custom message using static function I am not able to send single message as we…
Mannu saraswat
  • 1,061
  • 8
  • 15
-2
votes
2 answers

Laravel - How to Validate Grading System in Model and Controller

I am developing A web Application using Laravel-5.8 framework. I have a Model Class as shown below:
ayobamilaye
  • 429
  • 2
  • 10
  • 25
-2
votes
1 answer

Laravel issue with create()

I've just started some tutorial about Laravel and I got some trouble with this code: public function store(Request $request ) { $product = $this->validate(request(), [ 'name' => 'required', 'price' =>…
riten
  • 185
  • 1
  • 12
-2
votes
3 answers

Laravel 5 ON creating process on a model i get error

In my controller function want to create a model. class PropertyController extends AdminController { public function langUpdate(Request $request) { $result = PropertyRltLang::create($request->all()); return…
Mesuti
  • 878
  • 1
  • 13
  • 29
-3
votes
1 answer

when i try to migrate my profile table its giving me the error .i am using laravel 5.1

[Symfony\Component\Debug\Exception\FatalErrorException] syntax error, unexpected '(', expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' Here is my code public function up() { Schema::create('profile',…
Uzair Khan
  • 70
  • 3
  • 12
-5
votes
1 answer

laravel change validation default message from front side

Laravel change validation default message change validation message from front side read validation.php file and than write that file from front side is it possible ?
Harsh
  • 1
  • 1
1 2 3
56
57