persian error laravel 1

persian error laravel

1 ) go to this link 
  ( https://github.com/mojtabaRKS/laravel-persian-validation)  
2 )    and download the file 
3 ) and save it in this route 
   ( laravelProject\resources\lang ) 
   
   
4 )    now go to this route ( config\app.php ) 
5 )  and find the 'locale' => 'en'
6 )    and change it to this :  'locale' => 'fa'

Here is what the above code is Doing:
1. We’re importing the Validator class from the Illuminate\Support\Facades namespace.
2. We’re creating a new instance of the Validator class.
3. We’re passing the request data to the make method of the Validator class.
4. We’re passing the validation rules to the make method of the Validator class.
5. We’re calling the fails method of the Validator class to check if validation fails.
6. If validation fails, we’re redirecting the user back to the previous page.
7. If validation passes, we’re creating a new Post instance.
8. We’re setting the title and body attributes of the Post instance.
9. We’re calling the save method of the Post instance to save the post in the database.
10. We’re redirecting the user to the posts.index route and showing a success message.

Similar Posts