Laravel 5 how to validate route parameters?

For Laravel < 5.5: The way for this is overriding all() method for CheckTokenServerRequest like so: public function all() { $data = parent::all(); $data[‘token’] = $this->route(‘token’); return $data; } EDIT For Laravel >= 5.5: Above solution works in Laravel < 5.5. If you want to use it in Laravel 5.5 or above, you should use: … Read more

Laravel validation: exists with additional column condition – custom validation rule

From Laravel 5.3+ you can add a custom where clause to the exists and unique rules. Here is my scenario: I have an email verification table and I want to ensure that a passed machine code and activation code exist on the same row. Be sure to use Illuminate\Validation\Rule; $activationCode = $request->activation_code; $rules = [ … Read more

How add Custom Validation Rules when using Form Request Validation in Laravel 5

While the above answer is correct, in a lot of cases you might want to create a custom validation only for a certain form request. You can leverage laravel FormRequest and use dependency injection to extend the validation factory. I think this solution is much simpler than creating a service provider. Here is how it … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)