Laravel 5.3 Form Helpers and CRUD Controller Methods

Connor Leech
Employbl
Published in
6 min readJan 8, 2017

--

In this tutorial we are going to build forms in Laravel for creating and editing our data. We will also define all the controller methods required for CRUD operations.

Right now we have out form field in a home.blade.php file. We have the Candidate controller and model set up in PHP on the server side, now it is time to render our markup using Blade Templates.

If you want to follow along the source code is available here: https://github.com/connor11528/laravel-5.3-app (Give it 🌟 on the githubs!)

This is the fourth article working on this codebase. We added authentication, made a typeahead Google Maps component and set up a model + controller in the previous articles.

Use Laravel 5.3 Form Helpers

Laravel Collective maintains Forms & HTML helpers that have been removed from the core framework but are widely used. It helps us write less code and build HTML forms. Install the tool with composer:

composer require "laravelcollective/html":"^5.3.0"

Next, add your new provider to the providers array of config/app.php:

'providers' => [
// ...
Collective\Html\HtmlServiceProvider::class,
// ...
],

--

--

Connor Leech
Employbl

Girl Dad x 2. Cofounder @Employbl. Software Engineer @CommentSold.