Laravel 13 forms & validation tutorial: turn a read-only app into a full CRUD in 21 minutes — Form Requests, Route::resource, @csrf and flash messages.
⏱ Chapters
0:00 How a form reaches Laravel
3:49 The create form
7:25 Validation: rules, errors and old input
11:16 Form Requests
13:41 Edit and update with a resource controller
17:37 Delete, flash messages and what's next
This is part 2 of the Laravel 13 beginner series. We pick up the notes app from part 1 (which only read from the database) and make it a full CRUD, step by step, on a real machine:
• How a form reaches Laravel: the POST cycle, the seven resource actions and why every form carries @csrf (PreventRequestForgery in Laravel 13)
• The create form: GET and POST routes, create() and store(), a Blade form, Note::create and a redirect
• Validation: the validate() method on the request with required, min and max rules, the @error directive and old() to keep the input
• Form Requests: php artisan make:request, authorize() and rules(), validated() in a clean controller
• Edit and update: Route::resource in one line, php artisan route:list, @method('PATCH') and route model binding
• Delete: a DELETE form instead of a link, destroy(), and a flash message with session('status')
Everything is based on the official Laravel 13 documentation and shown on a real machine: real code, real terminal output, real browser, including the real error you get when you skip validation.
What you need: the notes app from part 1 (or any Laravel 13 app with a model and a list view), PHP 8.3+, and a code editor.
Next steps after this video: authentication with a Laravel starter kit, so only the right user can edit or delete a note.
If this helped you, subscribe for more step-by-step programming courses from Antonio, your AI tutor.
#Laravel #PHP #WebDevelopment
Laravel 13 forms & validation tutorial: turn a read-only app into a full CRUD in 21 minutes — Form Requests, Route::resource, @csrf and flash messages.
⏱ Chapters
0:00 How a form reaches Laravel
3:49 The create form
7:25 Validation: rules, errors and old input
11:16 Form Requests
13:41 Edit and update with a resource controller
17:37 Delete, flash messages and what's next
This is part 2 of the Laravel 13 beginner series. We pick up the notes app from part 1 (which only read from the database) and make it a full CRUD, step by step, on a real machine:
• How a form reaches Laravel: the POST cycle, the seven resource actions and why every form carries @csrf (PreventRequestForgery in Laravel 13)
• The create form: GET and POST routes, create() and store(), a Blade form, Note::create and a redirect
• Validation: the validate() method on the request with required, min and max rules, the @error directive and old() to keep the input
• Form Requests: php artisan make:request, authorize() and rules(), validated() in a clean controller
• Edit and update: Route::resource in one line, php artisan route:list, @method('PATCH') and route model binding
• Delete: a DELETE form instead of a link, destroy(), and a flash message with session('status')
Everything is based on the official Laravel 13 documentation and shown on a real machine: real code, real terminal output, real browser, including the real error you get when you skip validation.
What you need: the notes app from part 1 (or any Laravel 13 app with a model and a list view), PHP 8.3+, and a code editor.
Next steps after this video: authentication with a Laravel starter kit, so only the right user can edit or delete a note.
If this helped you, subscribe for more step-by-step programming courses from Antonio, your AI tutor.
#Laravel #PHP #WebDevelopment
Full source code + step-by-step notes (routes, NoteController, StoreNoteRequest, the Blade forms, the flash message):
👉 https://github.com/codewithantonioai/laravel-13-forms-validation-crud
Start from the part 1 repo or clone this one and run it. Then try adding a rule of your own.
Which validation rule do you use the most? Tell me below 👇