ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

#115

Автор: Stack Developers

Загружено: 2019-03-11

Просмотров: 1450

Описание: In Part-115 of E-com Series, we will first upgrade our Laravel 5.7 project to Laravel 5.8 that recently launched and after that we will add Laravel validations to the contact form.

1) Update composer.json file :-
First of all, update laravel/framework to 5.8.* from 5.7.* at composer.json file located at the root of our Laravel project.

2) Run "composer update" command :-
Now run "composer update" command to upgrade laravel 5.7 to 5.8 of our Laravel project. Verify once with php artisan --version to make sure laravel version has been updated to 5.8

Now we can continue working on Contact form and will add Laravel validations this time. We can take help from below Laravel link :-
https://laravel.com/docs/5.8/validation

3) Update contact function :-
Update contact function located at CmsController and write validator code for name and email as shown in video.

4) Update contact.blade.php file :-
Now update contact.blade.php file to display the error if validation fails for name or email. You can check this at Laravel website https://laravel.com/docs/5.8/validati... under "Displaying The Validation Errors" section.

5) Update Header Statement :-
Now add below statement at the top of CmsController :-
use Validator;

Check now validation is working fine. Now we will make it more secure by adding more options in validation.

6) Update contact function :-
We want to allow the user to add alphabets only and laravel provides alpha option but it will not allow spaces so we will search on net for better solution.

Search for the keyword like 'laravel validation for alphabetic characters and spaces' and open below stackoverflow link to find the solution.

https://stackoverflow.com/questions/3...

We will add regular expression for allowing alphabets with spaces as shown in video.

We can add other validation rules as well from Laravel website :-
https://laravel.com/docs/5.8/validati...

Thanks for watching :)

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
#115

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]