{"id":805,"date":"2019-09-26T19:20:50","date_gmt":"2019-09-26T19:20:50","guid":{"rendered":"https:\/\/www.programmingfields.com\/?p=805"},"modified":"2026-05-02T06:32:34","modified_gmt":"2026-05-02T06:32:34","slug":"laravel-6-crud-application","status":"publish","type":"post","link":"https:\/\/programmingfields.com\/laravel-6-crud-application\/","title":{"rendered":"Laravel 6 CRUD Application For Beginners"},"content":{"rendered":"\n<p>Laravel 6 CRUD application will contain the approach to create and use the <strong>Insert<\/strong>, <strong>Select<\/strong>, <strong>Update<\/strong>, and Delete functionalities. You can build your own advanced applications by using this concept in Laravel 6. Laravel has several inbuilt features that make it more secure, robust, and authentic to our application. Before moving to the Laravel 6 crud tutorial, make sure your system is ready for creating Laravel applications. If you haven&#8217;t configured your system for Laravel then please go through the <a href=\"https:\/\/programmingfields.com\/laravel-install-with-composer\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Installation of Laravel 6 in Windows and Ubuntu<\/a><\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/programmingfields.com\/laravel-6-crud-application\/#Requirements_for_Creating_Laravel_6_Project\" >Requirements for Creating Laravel 6 Project<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/programmingfields.com\/laravel-6-crud-application\/#Prerequisites\" >Prerequisites<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/programmingfields.com\/laravel-6-crud-application\/#Create_New_Laravel_6_CRUD_Project\" >Create New Laravel 6 CRUD Project<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/programmingfields.com\/laravel-6-crud-application\/#Install_Frontend_Dependencies_in_Laravel\" >Install Frontend Dependencies in Laravel<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/programmingfields.com\/laravel-6-crud-application\/#Create_and_Configure_MySQL_Database\" >Create and Configure MySQL Database<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/programmingfields.com\/laravel-6-crud-application\/#Create_the_Model_and_Migration_Files\" >Create the Model and Migration Files<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/programmingfields.com\/laravel-6-crud-application\/#Add_Fillable_Data_in_Model\" >Add Fillable Data in Model<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/programmingfields.com\/laravel-6-crud-application\/#Migrate_the_Database_Table\" >Migrate the Database Table<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/programmingfields.com\/laravel-6-crud-application\/#Create_Controller_in_Laravel_6\" >Create Controller in Laravel 6<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/programmingfields.com\/laravel-6-crud-application\/#Create_Routes_in_Laravel_6\" >Create Routes in Laravel 6<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/programmingfields.com\/laravel-6-crud-application\/#Create_Views_in_Laravel_6\" >Create Views in Laravel 6<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/programmingfields.com\/laravel-6-crud-application\/#Load_Blade_File_into_Controller\" >Load Blade File into Controller<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/programmingfields.com\/laravel-6-crud-application\/#Run_Laravel_Project\" >Run Laravel Project<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/programmingfields.com\/laravel-6-crud-application\/#Add_Form_Validation_Rules_and_Save_Data\" >Add Form Validation Rules and Save Data<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/programmingfields.com\/laravel-6-crud-application\/#Listing_Data_in_Laravel_6_CRUD_Example\" >Listing Data in Laravel 6 CRUD Example<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/programmingfields.com\/laravel-6-crud-application\/#Display_Single_Data_in_Laravel_6_CRUD\" >Display Single Data in Laravel 6 CRUD<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/programmingfields.com\/laravel-6-crud-application\/#Edit_and_Update_Data_in_Laravel_6\" >Edit and Update Data in Laravel 6<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/programmingfields.com\/laravel-6-crud-application\/#Update_Data_By_Id\" >Update Data By Id<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/programmingfields.com\/laravel-6-crud-application\/#Delete_Student_Record_in_Laravel_6_CRUD\" >Delete Student Record in Laravel 6 CRUD<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/programmingfields.com\/laravel-6-crud-application\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Requirements_for_Creating_Laravel_6_Project\"><\/span>Requirements for Creating Laravel 6 Project<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>It is most important, follows the below requirements before creating a new project.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>PHP &gt;= 7.2.0<\/strong>&nbsp;version.<\/li><li><strong>OpenSSL<\/strong>&nbsp;extension for the PHP.<\/li><li>BCMath PHP Extension.<\/li><li>Ctype PHP Extension<\/li><li>JSON PHP Extension<\/li><li>Mbstring PHP Extension<\/li><li>PDO PHP Extension<\/li><li>Tokenizer PHP Extension<\/li><li>XML PHP Extension<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Prerequisites\"><\/span>Prerequisites<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>For creating this Laravel 6 CRUD application, I&#8217;m going to use the <a rel=\"noreferrer noopener\" aria-label=\"Visual Studio Code (opens in a new tab)\" href=\"https:\/\/visualstudio.microsoft.com\/\" target=\"_blank\">Visual Studio Code<\/a>. However, if you haven&#8217;t downloaded then please download and configure it for the development. You can use any editor as you want.<\/p>\n\n\n\n<p>Consequently, let&#8217;s continue to the project.<\/p>\n\n\n\n<p class=\"has-text-align-center\"><a href=\"https:\/\/www.programmingfields.com\/upload-files-and-images-in-laravel-6\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">How to Upload Files and Images in Laravel 6 with Validation<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create_New_Laravel_6_CRUD_Project\"><\/span>Create New Laravel 6 CRUD Project<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To create a new project in Laravel 6, we&#8217;ll be using the <strong>composer-create<\/strong> project command. Just open your command prompt (windows user) and type the below command.<\/p>\n\n\n\n<pre title=\"Create New Project\" class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">composer create-project --prefer-dist laravel\/laravel crud<\/code><\/pre>\n\n\n\n<p>It will create a folder with the application name and will start the installation of the Laravel.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.programmingfields.com\/wp-content\/uploads\/2019\/09\/Laravel-6-CRUD-project.png?resize=730%2C255&#038;ssl=1\" alt=\"Laravel 6 Create Project\" class=\"wp-image-828\" width=\"730\" height=\"255\" srcset=\"https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Laravel-6-CRUD-project.png?w=730&amp;ssl=1 730w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Laravel-6-CRUD-project.png?resize=300%2C105&amp;ssl=1 300w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><figcaption>Creating Laravel 6 CRUD Application<\/figcaption><\/figure><\/div>\n\n\n\n<p>Once the project creation has been completed, navigate to the project directory by the <code>cd<\/code> command.<\/p>\n\n\n\n<p class=\"has-text-align-center\"><a href=\"https:\/\/www.programmingfields.com\/laravel-6-login-and-registration-with-authentication\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Laravel 6 Login and Registration with Authentication<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Install_Frontend_Dependencies_in_Laravel\"><\/span>Install Frontend Dependencies in Laravel<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Laravel provides the front-end dependencies so you will need to install it by the following command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">npm install<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.programmingfields.com\/wp-content\/uploads\/2019\/09\/npm-install.png?resize=1081%2C147&#038;ssl=1\" alt=\"Laravel 6 npm install\" class=\"wp-image-835\" width=\"1081\" height=\"147\" srcset=\"https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/npm-install.png?w=1081&amp;ssl=1 1081w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/npm-install.png?resize=300%2C41&amp;ssl=1 300w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/npm-install.png?resize=768%2C104&amp;ssl=1 768w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/npm-install.png?resize=1024%2C139&amp;ssl=1 1024w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><figcaption>Installing npm laravel<\/figcaption><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.programmingfields.com\/wp-content\/uploads\/2019\/09\/NPM-install-2.png?resize=1105%2C180&#038;ssl=1\" alt=\"Laravel 6 npm install\" class=\"wp-image-861\" width=\"1105\" height=\"180\" srcset=\"https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/NPM-install-2.png?w=1105&amp;ssl=1 1105w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/NPM-install-2.png?resize=300%2C49&amp;ssl=1 300w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/NPM-install-2.png?resize=768%2C125&amp;ssl=1 768w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/NPM-install-2.png?resize=1024%2C167&amp;ssl=1 1024w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><figcaption>npm installed<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create_and_Configure_MySQL_Database\"><\/span>Create and Configure MySQL Database<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Open <strong>phpMyAdmin<\/strong> and create a new database there. In my case, I have created a database with a name <code>laravel6_crud<\/code><\/li><li>Now, in the project folder navigate to .env file and configure the MySQL database credentials as below.<\/li><\/ol>\n\n\n\n<pre title=\".env file\" class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">DB_CONNECTION=mysql\nDB_HOST=127.0.0.1\nDB_PORT=3306\nDB_DATABASE=laravel6_crud\nDB_USERNAME=root\nDB_PASSWORD=root<\/code><\/pre>\n\n\n\n<p>Actually, I am going to create the laravel 6 crud application in which, I will work on the student module. Here, I will store the student&#8217;s data into the database table. Then, that data will be retrieved in a tabular format. Also, I will work for edit\/update and delete of the student record.<\/p>\n\n\n\n<p class=\"has-text-align-center\"><a href=\"https:\/\/www.programmingfields.com\/dropdown-selection-filter-in-php-using-jquery-ajax\/\">Dropdown Selection Filter in PHP Using jQuery Ajax<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create_the_Model_and_Migration_Files\"><\/span>Create the Model and Migration Files<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In the next step, create a Model with the migration of the table. Laravel provides a way to create the database table using command. Using the migration the laravel can manage the version of the database table on each update of fields.<\/p>\n\n\n\n<p>For creating the Model, laravel has artisan command. So, type the below command to create the model and also a migration file. Here, I am going to create a Model of <strong>Student<\/strong> along with it&#8217;s migration file.<\/p>\n\n\n\n<pre title=\"Make Model and Migration\" class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">php artisan make:model Student --migration<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.programmingfields.com\/wp-content\/uploads\/2019\/09\/Model-and-migration.png?resize=771%2C112&#038;ssl=1\" alt=\"Laravel 6 Make Model\" class=\"wp-image-845\" width=\"771\" height=\"112\" srcset=\"https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Model-and-migration.png?w=771&amp;ssl=1 771w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Model-and-migration.png?resize=300%2C44&amp;ssl=1 300w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Model-and-migration.png?resize=768%2C112&amp;ssl=1 768w\" sizes=\"auto, (max-width: 771px) 100vw, 771px\" \/><figcaption>Creating Model and Migration<\/figcaption><\/figure><\/div>\n\n\n\n<p>Once, the migration file has been created navigate to the <strong>database-&gt;migrations<\/strong> in your project files.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"459\" height=\"157\" src=\"https:\/\/i0.wp.com\/www.programmingfields.com\/wp-content\/uploads\/2019\/09\/Migration.png?resize=459%2C157&#038;ssl=1\" alt=\"Laravel 6 Database Migrations\" class=\"wp-image-851\" srcset=\"https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Migration.png?w=459&amp;ssl=1 459w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Migration.png?resize=300%2C103&amp;ssl=1 300w\" sizes=\"auto, (max-width: 459px) 100vw, 459px\" \/><figcaption>Database Migration Files<\/figcaption><\/figure><\/div>\n\n\n\n<p>Now, open the <strong>create_students_table.php<\/strong> file inside the migrations. Set the <strong>students table<\/strong> schema as below.<\/p>\n\n\n\n<pre title=\"Table Schema\" class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\"> public function up()\n    {\n        Schema::create('students', function (Blueprint $table) {\n            $table->bigIncrements('id');\n            $table->string('first_name');\n            $table->string('last_name');\n            $table->string('full_name');\n            $table->date('dob');\n            $table->string('gender');\n            $table->string('email');\n            $table->string('phone');\n            $table->string('address');\n            $table->integer('zipcode');\n            $table->tinyInteger('is_deleted')->default(0);\n            $table->timestamps();\n        });\n    }<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-center\"><a href=\"https:\/\/www.programmingfields.com\/ajax-php-form-handling-using-jquery\/\">Ajax PHP Form Handling Using jQuery \u2013 Submit Form Without Refresh<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Add_Fillable_Data_in_Model\"><\/span>Add Fillable Data in Model<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Open the Student model inside the <strong>app<\/strong> and paste the below code for mass assignment in the students table.<\/p>\n\n\n\n<pre title=\"Student.php\" class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">&lt;?php\n\nnamespace App;\n\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass Student extends Model\n{\n    \/\/ Mass Assignment\n    protected $fillable = [\n            'first_name', 'last_name', 'full_name', 'dob', 'gender', 'address', 'zipcode'\n    ];\n}\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Migrate_the_Database_Table\"><\/span>Migrate the Database Table<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Once, you have done with the model, it&#8217;s time to migrate the table schema into the database. During migration, the schema of the table will be created into the database. The migration contains the version of the table schema which can be managed anytime.<\/p>\n\n\n\n<pre title=\"Migrate Table\" class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">php artisan migrate<\/code><\/pre>\n\n\n\n<p>Here, in the migration, the laravel has created the tables in the database automatically for which the migration has been created.<\/p>\n\n\n\n<p>So you can see here, the migration table has been created successfully.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.programmingfields.com\/wp-content\/uploads\/2019\/09\/Create-migration.png?resize=942%2C206&#038;ssl=1\" alt=\"Laravel 6 Migrate\" class=\"wp-image-863\" width=\"942\" height=\"206\" srcset=\"https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Create-migration.png?w=942&amp;ssl=1 942w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Create-migration.png?resize=300%2C66&amp;ssl=1 300w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Create-migration.png?resize=768%2C168&amp;ssl=1 768w\" sizes=\"auto, (max-width: 942px) 100vw, 942px\" \/><figcaption>Migrated Database Table<\/figcaption><\/figure><\/div>\n\n\n\n<p>You can check into the database for the tables that have been created after the migration.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.programmingfields.com\/wp-content\/uploads\/2019\/09\/Database-Table.png?resize=1014%2C185&#038;ssl=1\" alt=\"Database Structure\" class=\"wp-image-865\" width=\"1014\" height=\"185\" srcset=\"https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Database-Table.png?w=1014&amp;ssl=1 1014w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Database-Table.png?resize=300%2C55&amp;ssl=1 300w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Database-Table.png?resize=768%2C140&amp;ssl=1 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><figcaption>Tables after migration<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"has-text-align-center\"><a href=\"https:\/\/www.programmingfields.com\/check-if-email-available-in-php-using-ajax\/\">Check Email Available in PHP MySQL Using jQuery and Ajax<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create_Controller_in_Laravel_6\"><\/span>Create Controller in Laravel 6<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>For our laravel 6 crud operation, we will need to create a controller for the student in which we&#8217;ll handle the logical operations of the students. <\/p>\n\n\n\n<p>Therefore to create the controller you will need to type the below artisan command in the terminal.<\/p>\n\n\n\n<pre title=\"Create Controller\" class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">php artisan make:controller StudentController --resource<\/code><\/pre>\n\n\n\n<p>The above command will create a StudentController with the resource. Laravel provides the resource as the list of methods for performing the CRUD operations. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.programmingfields.com\/wp-content\/uploads\/2019\/09\/Student-Controller.png?resize=804%2C79&#038;ssl=1\" alt=\"Laravel 6 Create Controller\" class=\"wp-image-871\" width=\"804\" height=\"79\" srcset=\"https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Student-Controller.png?w=804&amp;ssl=1 804w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Student-Controller.png?resize=300%2C29&amp;ssl=1 300w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Student-Controller.png?resize=768%2C75&amp;ssl=1 768w\" sizes=\"auto, (max-width: 804px) 100vw, 804px\" \/><figcaption>Create StudentController<\/figcaption><\/figure><\/div>\n\n\n\n<p>The list of resource methods are the following-<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>index()<\/strong><\/li><li><strong>create()<\/strong><\/li><li><strong>store()<\/strong><\/li><li><strong>show()<\/strong><\/li><li><strong>edit()<\/strong><\/li><li><strong>update()<\/strong><\/li><li><strong>destroy()<\/strong><\/li><\/ol>\n\n\n\n<p>Hence, we can use the above methods for CRUD operations. You can custom methods too. But for that, you will have to define the <strong><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/laravel.com\/docs\/6.x\/routing\" target=\"_blank\">routes<\/a><\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create_Routes_in_Laravel_6\"><\/span>Create Routes in Laravel 6<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Routing in the laravel is the most important part which defines the interface of the web URL of the controller. In other words, when the method calls, these routes load. On the other hand, it is the only way which helps us to manage the request URL in the laravel.<\/p>\n\n\n\n<p>Therefore, creating the routes of the StudentController, navigate to the <strong>routes <\/strong>folder and open the <strong>web.php<\/strong> file.<\/p>\n\n\n\n<p>In this post, we are creating the Web Application so our routes will be defined under the <strong>web.php<\/strong> file. Similarly, when we&#8217;ll work on the <strong>REST API<\/strong> then we&#8217;ll need to define the routes under the <strong>api.php<\/strong> file.<\/p>\n\n\n\n<p>You can see the route list in the laravel by the following command &#8211;<\/p>\n\n\n\n<pre title=\"Route List\" class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">php artisan route:list<\/code><\/pre>\n\n\n\n<p>It will display all the routes available in the controller. In our case, we have the StudentController with the resource methods. So, here all the routes are listed with the name, action and the middleware.<\/p>\n\n\n\n<pre title=\"Route List\" class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">Methods   |  URI                   |  Name\t\t\t | Action \t\t\t\t\t\t\t\t\t\t   | Middleware\n=======================================================================================================================\n\nGET|HEAD  | student          \t   | student.index   | App\\Http\\Controllers\\StudentController@index    | web  |\n\nPOST      | student        \t\t   | student.store   | App\\Http\\Controllers\\StudentController@store    | web  |\n\nGET|HEAD  | student\/create \t\t   | student.create  | App\\Http\\Controllers\\StudentController@create   | web  |\n\nGET|HEAD  | student\/{student}\t   | student.show    | App\\Http\\Controllers\\StudentController@show     | web  |\n\nPUT|PATCH | student\/{student} \t   | student.update  | App\\Http\\Controllers\\StudentController@update   | web  |\n\nDELETE    | student\/{student} \t   | student.destroy | App\\Http\\Controllers\\StudentController@destroy  | web  |\n\nGET|HEAD  | student\/{student}\/edit | student.edit    | App\\Http\\Controllers\\StudentController@edit     | web  |<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.programmingfields.com\/wp-content\/uploads\/2019\/09\/Route-list.png?resize=1366%2C313&#038;ssl=1\" alt=\"Laravel 6 Route List\" class=\"wp-image-892\" width=\"1366\" height=\"313\" srcset=\"https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Route-list.png?w=1366&amp;ssl=1 1366w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Route-list.png?resize=300%2C69&amp;ssl=1 300w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Route-list.png?resize=768%2C176&amp;ssl=1 768w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Route-list.png?resize=1024%2C235&amp;ssl=1 1024w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure><\/div>\n\n\n\n<pre title=\"routes\/web.php\" class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">Route::resource('student', 'StudentController');<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.programmingfields.com\/wp-content\/uploads\/2019\/09\/web-routes.png?resize=775%2C167&#038;ssl=1\" alt=\"Laravel 6 CRUD Route\" class=\"wp-image-877\" width=\"775\" height=\"167\" srcset=\"https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/web-routes.png?w=775&amp;ssl=1 775w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/web-routes.png?resize=300%2C65&amp;ssl=1 300w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/web-routes.png?resize=768%2C165&amp;ssl=1 768w\" sizes=\"auto, (max-width: 775px) 100vw, 775px\" \/><figcaption>Creating Route for StudentController<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"has-text-align-center\"><a href=\"https:\/\/www.programmingfields.com\/datatable-in-php-with-mysql-database\/\">How to Implement jQuery Datatable in PHP with MySQL<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create_Views_in_Laravel_6\"><\/span>Create Views in Laravel 6<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In the next step, we will require to create views for the student. Views mainly define the user interface from which you can interact with. All the design interfaces contain by the views.<\/p>\n\n\n\n<p>All the views reside under the <strong>resources-&gt;views<\/strong> folder. In the laravel, views can be created with the <strong>.blade.php<\/strong> extension.<\/p>\n\n\n\n<p>So, I&#8217;ll be creating the following views here-<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>layout.blade.php<\/strong><\/li><li><strong>create.blade.php<\/strong><\/li><li><strong>index.blade.php<\/strong><\/li><li><strong>show.blade.php<\/strong><\/li><li><strong>update.blade.php<\/strong><\/li><\/ol>\n\n\n\n<p>The <strong>layout.blade.php<\/strong> file is the master layout and I will use this blade file in the other blade file by extending it.<\/p>\n\n\n\n<pre title=\"layout.blade.php\" class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">{{-- layout.blade.php --}}\n\n&lt;!DOCTYPE html>\n    &lt;html lang=\"en\">\n        &lt;head>\n            &lt;title> Laravel 6 CRUD Example &lt;\/title>\n            &lt;meta charset=\"UTF-8\">\n            &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n            &lt;meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n            &lt;link rel=\"stylesheet\" href=\"https:\/\/stackpath.bootstrapcdn.com\/bootstrap\/4.3.1\/css\/bootstrap.min.css\" integrity=\"sha384-ggOyR0iXCbMQv3Xipma34MD+dH\/1fQ784\/j6cY\/iJTQUOhcWr7x9JvoRxT2MZw1T\" crossorigin=\"anonymous\">\n        &lt;\/head>\n    &lt;body>\n        &lt;div class=\"container\">\n                @yield('content')\n        &lt;\/div>\n        &lt;script src=\"https:\/\/code.jquery.com\/jquery-3.3.1.slim.min.js\" integrity=\"sha384-q8i\/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo\" crossorigin=\"anonymous\">&lt;\/script>\n        &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/popper.js\/1.14.7\/umd\/popper.min.js\" integrity=\"sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1\" crossorigin=\"anonymous\">&lt;\/script>\n        &lt;script src=\"https:\/\/stackpath.bootstrapcdn.com\/bootstrap\/4.3.1\/js\/bootstrap.min.js\" integrity=\"sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf\/nJGzIxFDsf4x0xIM+B07jRM\" crossorigin=\"anonymous\">&lt;\/script>\n    &lt;\/body>\n&lt;\/html>\n<\/code><\/pre>\n\n\n\n<p>Next, I will extend the above layout for creating the form. So, for <strong>create.blade.php<\/strong> file, paste the below code.<\/p>\n\n\n\n<pre title=\"create.blade.php\" class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">{{ -- create.blade.php -- }}\n\n@extends('.\/student\/head')\n  &lt;body>\n    &lt;div class=\"container mt-3\">\n        &lt;form action=\"{{ route('student.store') }}\" method=\"post\">\n                &lt;div class=\"row\">\n                    &lt;div class=\"col-xl-8 p-4 m-auto shadow\">\n                        &lt;div class=\"card\">\n                            &lt;div class=\"card-header\">\n                                &lt;h5 class=\"card-title text-info\"> Add Student &lt;\/h5>\n                            &lt;\/div>\n                        &lt;div class=\"card-body\">\n\n                        {{--  print success message  --}}\n                                    @if(Session::has('success'))\n                                        &lt;div class=\"alert alert-success\">\n                                            {{ Session::get('success') }}\n                                            @php\n                                                Session::forget('success');\n                                            @endphp\n                                        &lt;\/div>\n                                    @endif\n\n                                     &lt;div class=\"row\">\n                                        &lt;div class=\"col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12 m-auto\">\n                                                &lt;div class=\"form-group\" {{ $errors->has('first_name') ? 'has-error' : ''}}>\n                                                    &lt;label> First Name &lt;\/label>\n                                                    &lt;input type=\"text\" name=\"first_name\" placeholder=\"First Name\" class=\"form-control\" value=\"{{ old('first_name')}}\">\n                                                    {!! $errors->first('first_name', '&lt;small class=\"text-danger\">:message&lt;\/small>') !!}\n                                                &lt;\/div>\n\n                                                &lt;div class=\"form-group\" {{ $errors->has('dob') ? 'has-error' : ''}}>\n                                                    &lt;label> Date of Birth &lt;\/label>\n                                                    &lt;input type=\"date\" name=\"dob\" placeholder=\"Date of Birth\" class=\"form-control\" value=\"{{ old('dob') }}\">\n                                                    {!! $errors->first('dob', '&lt;small class=\"text-danger\">:message&lt;\/small>') !!}\n                                                &lt;\/div>\n\n                                                &lt;div class=\"form-group\" {{ $errors->has('email') ? 'has-error' : ''}}>\n                                                    &lt;label> Email &lt;\/label>\n                                                    &lt;input type=\"text\" name=\"email\" placeholder=\"Email\" class=\"form-control\" value=\"{{ old('email') }}\">\n                                                    {!! $errors->first('email', '&lt;small class=\"text-danger\">:message &lt;\/small>') !!}\n                                                &lt;\/div>\n\n                                                &lt;div class=\"form-group\" {{ $errors->has('address') ? 'has-error' : ''}}>\n                                                    &lt;label> Address &lt;\/label>\n                                                        &lt;input class=\"form-control\" placeholder=\"Address\" type=\"text\" name=\"address\" value=\"{{ old('address') }}\">\n                                                        {!! $errors->first('address', '&lt;small class=\"text-danger\">:message &lt;\/small>') !!}\n                                                &lt;\/div>\n                                            &lt;\/div>\n\n                                        &lt;div class=\"col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12 m-auto\">\n                                            &lt;div class=\"form-group\" {{ $errors->has('last_name') ? 'has-error' : ''}}>\n                                                &lt;label> Last Name &lt;\/label>\n                                                &lt;input type=\"text\" name=\"last_name\" placeholder=\"Last Name\" class=\"form-control\" value=\"{{ old('last_name') }}\">\n                                                {!! $errors->first('last_name', '&lt;small class=\"text-danger\">:message &lt;\/small>') !!}\n                                            &lt;\/div>\n\n                                            &lt;div class=\"form-group\" {{ $errors->has('gender') ? 'has-error' : ''}}>\n                                                &lt;label> Gender &lt;\/label>\n                                                &lt;select class=\"form-control\" name=\"gender\" value=\"{{ old('gender') }}\">\n                                                    &lt;option disabled selected> Select Gender &lt;\/option>\n                                                    &lt;option value=\"male\"> Male &lt;\/option>\n                                                    &lt;option value=\"female\"> Female &lt;\/option>\n                                                &lt;\/select>\n                                                {!! $errors->first('gender', '&lt;small class=\"text-danger\">:message &lt;\/small>') !!}\n                                            &lt;\/div>\n\n                                            &lt;div class=\"form-group\" {{ $errors->has('phone') ? 'has-error' : ''}}>\n                                                &lt;label> Phone &lt;\/label>\n                                                &lt;input type=\"phone\" name=\"phone\" placeholder=\"Phone no\" class=\"form-control\" value=\"{{ old('phone') }}\">\n                                                {!! $errors->first('phone', '&lt;small class=\"text-danger\">:message &lt;\/small>') !!}\n                                            &lt;\/div>\n\n                                            &lt;div class=\"form-group\" {{ $errors->has('zipcode') ? 'has-error' : ''}}>\n                                                &lt;label> Zipcode &lt;\/label>\n                                                &lt;input type=\"number\" name=\"zipcode\" class=\"form-control\" placeholder=\"Zipcode\" value=\"{{ old('zipcode') }}\">\n                                                {!! $errors->first('zipcode', '&lt;small class=\"text-danger\">:message &lt;\/small>') !!}\n                                            &lt;\/div>\n                                        &lt;\/div>\n                                    &lt;\/div>\n                                    &lt;div class=\"form-group\">\n                                        &lt;button type=\"submit\" class=\"btn btn-success\" name=\"submit\"> Submit &lt;\/button>\n                                    &lt;\/div>\n                                    {{csrf_field()}}\n                                &lt;\/div>\n                            &lt;\/div>\n                        &lt;\/div>\n                    &lt;\/div>\n                &lt;\/form>\n            &lt;\/div>\n        &lt;\/div>\n    &lt;\/div>\n@include('\/student\/footer')\n<\/code><\/pre>\n\n\n\n<p>In the above blade file, I have added form action to the <strong>store()<\/strong> method of the <strong>StudentController<\/strong>. Also, I have added the validation errors to next of each form fields. But, for this, you&#8217;ll have to add the validation rules in the controller in the same method.<\/p>\n\n\n\n<p>If the data will be inserted, it will display a success message with the session. Once, you are done with above, it is time to load the blade into the controller&#8217;s method.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Load_Blade_File_into_Controller\"><\/span>Load Blade File into Controller<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Once, you have created the blade files, it required to load the blade.php files in the controller&#8217;s method. As we know that, we can run blade file (views) directly in the <strong>MVC<\/strong>. So navigate to the <strong>StudentController.php<\/strong> file and inside the create() method just paste the below code to load the <strong>create.blade.php<\/strong> file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\"> public function create()\n    {\n        return view('student\/create');\n    }<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Run_Laravel_Project\"><\/span>Run Laravel Project<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To see the result we need to run the laravel project by artisan command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">php artisan serve<\/code><\/pre>\n\n\n\n<p>The laravel default host will be started on localhost with port 8000. So according to the route we can access the student controller by the following URL.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">http:\/\/localhost:8000\/student\/create<\/code><\/pre>\n\n\n\n<p>It will show the result like this.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.programmingfields.com\/wp-content\/uploads\/2019\/09\/Laravel-6-CRUD-Application.png?resize=883%2C597&#038;ssl=1\" alt=\"Laavel 6 CRUD Example\" class=\"wp-image-888\" width=\"883\" height=\"597\" srcset=\"https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Laravel-6-CRUD-Application.png?w=883&amp;ssl=1 883w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Laravel-6-CRUD-Application.png?resize=300%2C203&amp;ssl=1 300w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Laravel-6-CRUD-Application.png?resize=768%2C519&amp;ssl=1 768w\" sizes=\"auto, (max-width: 883px) 100vw, 883px\" \/><figcaption>Create Student Form<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Add_Form_Validation_Rules_and_Save_Data\"><\/span>Add Form Validation Rules and Save Data<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this step, we will add validation rules for the form so that the controller will return to the form if form fields are null. The form action of <strong>create.blade.php<\/strong> file to the store() method of <strong>StudentController<\/strong>. So, we&#8217;ll need to add the validation rules inside the store() method.<\/p>\n\n\n\n<p>Also, after the validation success, the data will be inserted into the database.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">public function store(Request $request) {\n\n        $request->validate([\n            'first_name'        =>          'required',\n            'last_name'         =>          'required',\n            'gender'            =>          'required',\n            'dob'               =>          'required',\n            'email'             =>          'required|email',\n            'phone'             =>          'required',\n            'address'           =>          'required',\n            'zipcode'           =>          'required',\n        ]);\n\n        $input                   =           $request->all();\n        $input['full_name']      =           $input['first_name'] . \" \".$input['last_name'];\n        $student                 =           Student::create($input);\n        return back()->with('success', 'Record created successfully');\n    }<\/code><\/pre>\n\n\n\n<p>In the below result, you can see the validation errors are properly displayed after each input field.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.programmingfields.com\/wp-content\/uploads\/2019\/09\/Validation-errors-2.png?resize=886%2C656&#038;ssl=1\" alt=\"Laravel Form Validation Error\" class=\"wp-image-902\" width=\"886\" height=\"656\" srcset=\"https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Validation-errors-2.png?w=886&amp;ssl=1 886w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Validation-errors-2.png?resize=300%2C222&amp;ssl=1 300w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Validation-errors-2.png?resize=768%2C569&amp;ssl=1 768w\" sizes=\"auto, (max-width: 886px) 100vw, 886px\" \/><figcaption>Form Validation Error to Next of Each Inputs<\/figcaption><\/figure><\/div>\n\n\n\n<p>If the inputs are validated, the data will insert into the database.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.programmingfields.com\/wp-content\/uploads\/2019\/09\/Data-saved.png?resize=806%2C640&#038;ssl=1\" alt=\"Laravel 6 CRUD \" class=\"wp-image-907\" width=\"806\" height=\"640\" srcset=\"https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Data-saved.png?w=806&amp;ssl=1 806w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Data-saved.png?resize=300%2C238&amp;ssl=1 300w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Data-saved.png?resize=768%2C610&amp;ssl=1 768w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><figcaption>Data saved success<\/figcaption><\/figure><\/div>\n\n\n\n<p>So, I have added some data into the database.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.programmingfields.com\/wp-content\/uploads\/2019\/09\/Data-in-the-table.png?resize=1114%2C244&#038;ssl=1\" alt=\"Database Table\" class=\"wp-image-911\" width=\"1114\" height=\"244\" srcset=\"https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Data-in-the-table.png?w=1114&amp;ssl=1 1114w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Data-in-the-table.png?resize=300%2C66&amp;ssl=1 300w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Data-in-the-table.png?resize=768%2C168&amp;ssl=1 768w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Data-in-the-table.png?resize=1024%2C224&amp;ssl=1 1024w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><figcaption>Data inside the database<\/figcaption><\/figure><\/div>\n\n\n\n<p>Now, I will fetch all the data from the student table.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Listing_Data_in_Laravel_6_CRUD_Example\"><\/span>Listing Data in Laravel 6 CRUD Example<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>For displaying all the data from the database, you will require to write the below code inside the <strong>index()<\/strong> function of the <strong>StudentController<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">public function index()\n    {\n        \/\/ Display data\n        $students       =       Student::all();\n\n        \/\/ passing data into view\n        return view('student\/index', compact('students'));\n    }<\/code><\/pre>\n\n\n\n<p>Now,  you will need to create a table inside the <strong>index.blade.php<\/strong> file which has created above.<\/p>\n\n\n\n<pre title=\"index.blade.php\" class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">@extends('.\/student\/layout')\n&lt;div class=\"container mt-5\">\n    &lt;div class=\"row\">\n        &lt;div class=\"col-md-12\">\n            &lt;a href=\"{{ url('student\/create') }}\" class=\"btn btn-info float-right\">&lt;i class=\"fas fa-plus-circle\">&lt;\/i> Add New &lt;\/a>\n        &lt;\/div>\n    &lt;\/div>\n\n    &lt;table class=\"table table-striped table-bordered mt-4\">\n        &lt;thead>\n            &lt;th> Name &lt;\/th>\n            &lt;th> DOB &lt;\/th>\n            &lt;th> Gender &lt;\/th>\n            &lt;th> Email &lt;\/th>\n            &lt;th> Phone &lt;\/th>\n            &lt;th> Address &lt;\/th>\n            &lt;th> Zipcode &lt;\/th>\n            &lt;th> Action &lt;\/th>\n        &lt;\/thead>\n\n        &lt;tbody>\n            @foreach($students as $student)\n            &lt;tr>\n                &lt;td> {{ $student->full_name }} &lt;\/td>\n                &lt;td> {{ $student->dob }} &lt;\/td>\n                &lt;td> {{ $student->gender }} &lt;\/td>\n                &lt;td> {{ $student->email }} &lt;\/td>\n                &lt;td> {{ $student->phone }} &lt;\/td>\n                &lt;td> {{ $student->address }} &lt;\/td>\n                &lt;td> {{ $student->zipcode }} &lt;\/td>\n                &lt;td> &lt;a href=\"{{ route('student.show', $student->id )}}\" class=\"badge badge-info\"> View &lt;\/a>\n                    &lt;a href=\"{{ route('student.edit', $student->id )}}\" class=\"badge badge-success\"> Edit &lt;\/a>\n                    &lt;form action=\"{{ route('student.destroy', $student->id)}}\" method=\"post\">\n                     @csrf\n                     @method('DELETE')\n                        &lt;button class=\"badge btn-danger\" type=\"submit\"> Delete &lt;\/button>\n                   &lt;\/form>\n                &lt;\/td>\n            &lt;\/tr>\n            @endforeach\n        &lt;\/tbody>\n    &lt;\/table>\n&lt;\/div>\n<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i1.wp.com\/www.programmingfields.com\/wp-content\/uploads\/2019\/09\/Display-data-into-table.png?fit=1024%2C421&amp;ssl=1\" alt=\"Student Listing\" class=\"wp-image-912\" width=\"1024\" height=\"421\" srcset=\"https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Display-data-into-table.png?w=1171&amp;ssl=1 1171w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Display-data-into-table.png?resize=300%2C123&amp;ssl=1 300w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Display-data-into-table.png?resize=768%2C316&amp;ssl=1 768w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Display-data-into-table.png?resize=1024%2C421&amp;ssl=1 1024w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><figcaption>Displaying Data From the database<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Display_Single_Data_in_Laravel_6_CRUD\"><\/span>Display Single Data in Laravel 6 CRUD<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In the table of student listing, I have defined the action as View, Edit and Delete. So, when you will click on the View option, it will redirect you to another blade file in which the selected student record will be displayed there. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">public function show($id)\n    {\n        $student    =       Student::find($id);\n        return view('student\/show', compact('student'));\n    }<\/code><\/pre>\n\n\n\n<p>Now, paste the below snippet in the <strong>show.blade.php<\/strong> file. <\/p>\n\n\n\n<pre title=\"show.blade.php\" class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">{{ show.blade.php }}\n\n@extends('student\/layout')\n&lt;div class=\"container mt-3\">\n    &lt;div class=\"row\">\n        &lt;div class=\"col-xl-8 p-4 m-auto shadow\">\n            &lt;div class=\"card\">\n                &lt;div class=\"card-header\">\n                    &lt;h5 class=\"card-title text-info\"> Show Student &lt;\/h5>\n                &lt;\/div>\n\n                &lt;div class=\"card-body\">\n                    &lt;div class=\"row\">\n                        &lt;div class=\"col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12 m-auto\">\n\n                            &lt;div class=\"form-group\">\n                                &lt;label> First Name &lt;\/label>\n                                &lt;input type=\"text\" name=\"first_name\" disabled placeholder=\"First Name\" class=\"form-control\" value=\"{{ $student->first_name}}\">\n                            &lt;\/div>\n\n                            &lt;div class=\"form-group\">\n                                &lt;label> Date of Birth &lt;\/label>\n                                &lt;input type=\"date\" name=\"dob\" disabled placeholder=\"Date of Birth\" class=\"form-control\" value=\"{{ $student->dob }}\">\n                            &lt;\/div>\n\n                            &lt;div class=\"form-group\">\n                                &lt;label> Email &lt;\/label>\n                                &lt;input type=\"text\" name=\"email\" disabled placeholder=\"Email\" class=\"form-control\" value=\"{{ $student->email }}\">\n                            &lt;\/div>\n\n                            &lt;div class=\"form-group\">\n                                &lt;label> Address &lt;\/label>\n                                    &lt;input class=\"form-control\" disabled placeholder=\"Address\" type=\"text\" name=\"address\" value=\"{{ $student->address }}\">\n                            &lt;\/div>\n                        &lt;\/div>\n\n                    &lt;div class=\"col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12 m-auto\">\n                        &lt;div class=\"form-group\">\n                            &lt;label> Last Name &lt;\/label>\n                            &lt;input type=\"text\" name=\"last_name\" disabled placeholder=\"Last Name\" class=\"form-control\" value=\"{{ $student->last_name }}\">\n                        &lt;\/div>\n\n                        &lt;div class=\"form-group\">\n                            &lt;label> Gender &lt;\/label>\n                            &lt;select class=\"form-control\" name=\"gender\" disabled>\n                                @if($student->gender == \"male\")\n                                    &lt;option value=\"male\" selected> Male &lt;\/option>\n                                @elseif($student->gender == \"female\")\n                                    &lt;option value=\"female\"> Female &lt;\/option>\n                                @endif\n                            &lt;\/select>\n                        &lt;\/div>\n\n                        &lt;div class=\"form-group\">\n                            &lt;label> Phone &lt;\/label>\n                            &lt;input type=\"phone\" name=\"phone\" disabled placeholder=\"Phone no\" class=\"form-control\" value=\"{{ $student->phone }}\">\n                        &lt;\/div>\n\n                        &lt;div class=\"form-group\">\n                            &lt;label> Zipcode &lt;\/label>\n                            &lt;input type=\"number\" name=\"zipcode\" disabled class=\"form-control\" placeholder=\"Zipcode\" value=\"{{ $student->zipcode}}\">\n                        &lt;\/div>\n                    &lt;\/div>\n                &lt;\/div>\n\n                &lt;div class=\"form-group\">\n                    &lt;a href=\" {{ route('student.index')}}\" class=\"btn btn-danger\"> Close &lt;i class=\"fa fa-times-circle\">&lt;\/i>&lt;\/a>\n                &lt;\/div>\n\n                &lt;\/div>\n            &lt;\/div>\n        &lt;\/div>\n    &lt;\/div>\n<\/code><\/pre>\n\n\n\n<p>When you will click on the View button, then on the basis of the id of the selected student, all the data will be loaded into a form with disabled inputs.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.programmingfields.com\/wp-content\/uploads\/2019\/09\/Student-Show.png?resize=795%2C575&#038;ssl=1\" alt=\"Student Detail\" class=\"wp-image-915\" width=\"795\" height=\"575\" srcset=\"https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Student-Show.png?w=795&amp;ssl=1 795w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Student-Show.png?resize=300%2C217&amp;ssl=1 300w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Student-Show.png?resize=768%2C555&amp;ssl=1 768w\" sizes=\"auto, (max-width: 795px) 100vw, 795px\" \/><figcaption>Student Detail<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Edit_and_Update_Data_in_Laravel_6\"><\/span>Edit and Update Data in Laravel 6<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In the next step, I will edit and update the student data on the basis of the id. So when you will click on the <strong>edit<\/strong> button, it will redirect you to the <strong>update.blade.php<\/strong> file with all the data.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">public function edit($id)\n    {\n        $student    =       Student::find($id);\n        return view('student\/update', compact('student'));\n    }<\/code><\/pre>\n\n\n\n<p>Then paste the below code, in the <strong>update.blade.php<\/strong> file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">@extends('.\/student\/layout')\n  &lt;body>\n    &lt;div class=\"container mt-3\">\n        &lt;form action=\"{{ route('student.update', $student->id) }}\" method=\"post\">\n          {{csrf_field() }}\n              @method('PATCH')\n                &lt;div class=\"row\">\n         &lt;div class=\"col-xl-8 p-4 m-auto shadow\">\n                        &lt;div class=\"card\">\n                            &lt;div class=\"card-header\">\n                                &lt;h5 class=\"card-title text-info\"> Update Student &lt;\/h5>\n                            &lt;\/div>\n                        &lt;div class=\"card-body\">\n\n                    {{--  print success message  --}}\n                        @if(Session::has('success'))\n                            &lt;div class=\"alert alert-success\">\n                                {{ Session::get('success') }}\n                                @php\n                                    Session::forget('success');\n                                @endphp\n                            &lt;\/div>\n                        @endif\n\n                            &lt;div class=\"row\">\n                                &lt;div class=\"col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12 m-auto\">\n                                        &lt;div class=\"form-group\" {{ $errors->has('first_name') ? 'has-error' : ''}}>\n                                            &lt;label> First Name &lt;\/label>\n                                            &lt;input type=\"text\" name=\"first_name\" placeholder=\"First Name\" class=\"form-control\" value=\"{{ $student->first_name }}\">\n                                            {!! $errors->first('first_name', '&lt;small class=\"text-danger\">:message&lt;\/small>') !!}\n                                        &lt;\/div>\n\n                                        &lt;div class=\"form-group\" {{ $errors->has('dob') ? 'has-error' : ''}}>\n                                            &lt;label> Date of Birth &lt;\/label>\n                                            &lt;input type=\"date\" name=\"dob\" placeholder=\"Date of Birth\" class=\"form-control\" value=\"{{ $student->dob }}\">\n                                            {!! $errors->first('dob', '&lt;small class=\"text-danger\">:message&lt;\/small>') !!}\n                                        &lt;\/div>\n\n                                        &lt;div class=\"form-group\" {{ $errors->has('email') ? 'has-error' : ''}}>\n                                            &lt;label> Email &lt;\/label>\n                                            &lt;input type=\"text\" name=\"email\" placeholder=\"Email\" class=\"form-control\" value=\"{{ $student->email }}\">\n                                            {!! $errors->first('email', '&lt;small class=\"text-danger\">:message &lt;\/small>') !!}\n                                        &lt;\/div>\n\n                                        &lt;div class=\"form-group\" {{ $errors->has('address') ? 'has-error' : ''}}>\n                                            &lt;label> Address &lt;\/label>\n                                                &lt;input class=\"form-control\" placeholder=\"Address\" type=\"text\" name=\"address\" value=\"{{ $student->address }}\">\n                                                {!! $errors->first('address', '&lt;small class=\"text-danger\">:message &lt;\/small>') !!}\n                                        &lt;\/div>\n                                    &lt;\/div>\n\n                                &lt;div class=\"col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12 m-auto\">\n                                    &lt;div class=\"form-group\" {{ $errors->has('last_name') ? 'has-error' : ''}}>\n                                        &lt;label> Last Name &lt;\/label>\n                                        &lt;input type=\"text\" name=\"last_name\" placeholder=\"Last Name\" class=\"form-control\" value=\"{{ $student->last_name }}\">\n                                        {!! $errors->first('last_name', '&lt;small class=\"text-danger\">:message &lt;\/small>') !!}\n                                    &lt;\/div>\n\n                                    &lt;div class=\"form-group\" {{ $errors->has('gender') ? 'has-error' : ''}}>\n                                        &lt;label> Gender &lt;\/label>\n                                        &lt;select class=\"form-control text-capitalize\" name=\"gender\" value=\"{{ old('gender') }}\">\n                                            &lt;option value=\"{{ $student->gender }}\"> {{ $student->gender }} &lt;\/option>\n\n                                            @if($student->gender == \"male\")\n                                               &lt;option value=\"female\"> Female &lt;\/option>\n                                            @else\n                                                &lt;option value=\"male\"> Male &lt;\/option>\n                                            @endif\n                                        &lt;\/select>\n                                        {!! $errors->first('gender', '&lt;small class=\"text-danger\">:message &lt;\/small>') !!}\n                                    &lt;\/div>\n\n                                    &lt;div class=\"form-group\" {{ $errors->has('phone') ? 'has-error' : ''}}>\n                                        &lt;label> Phone &lt;\/label>\n                                        &lt;input type=\"phone\" name=\"phone\" placeholder=\"Phone no\" class=\"form-control\" value=\"{{ $student->phone }}\">\n                                        {!! $errors->first('phone', '&lt;small class=\"text-danger\">:message &lt;\/small>') !!}\n                                    &lt;\/div>\n\n                                    &lt;div class=\"form-group\" {{ $errors->has('zipcode') ? 'has-error' : ''}}>\n                                        &lt;label> Zipcode &lt;\/label>\n                                        &lt;input type=\"number\" name=\"zipcode\" class=\"form-control\" placeholder=\"Zipcode\" value=\"{{ $student->zipcode }}\">\n                                        {!! $errors->first('zipcode', '&lt;small class=\"text-danger\">:message &lt;\/small>') !!}\n                                    &lt;\/div>\n                                &lt;\/div>\n                            &lt;\/div>\n\n                            &lt;div class=\"form-group\">\n                                &lt;button type=\"submit\" class=\"btn btn-success\" name=\"submit\"> Submit &lt;\/button>\n                            &lt;\/div>\n\n                                &lt;\/div>\n                            &lt;\/div>\n                        &lt;\/div>\n                    &lt;\/div>\n                &lt;\/form>\n            &lt;\/div>\n        &lt;\/div>\n    &lt;\/div>\n<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.programmingfields.com\/wp-content\/uploads\/2019\/09\/Edit-Student.png?resize=817%2C577&#038;ssl=1\" alt=\"Update Student\" class=\"wp-image-917\" width=\"817\" height=\"577\" srcset=\"https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Edit-Student.png?w=817&amp;ssl=1 817w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Edit-Student.png?resize=300%2C212&amp;ssl=1 300w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Edit-Student.png?resize=768%2C542&amp;ssl=1 768w\" sizes=\"auto, (max-width: 817px) 100vw, 817px\" \/><figcaption>Edit Student <\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Update_Data_By_Id\"><\/span>Update Data By Id <span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here, I&#8217;m going to update the student detail by student id. So, after clicking the update button the form action will go to the update method inside the StudentController. Paste the below snippet there.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">\/\/ update student  \n\npublic function update(Request $request, $id)\n   {\n     $student     =    $request->validate([\n         'first_name'        =>          'required',\n         'last_name'         =>          'required',\n         'gender'            =>          'required',\n         'dob'               =>          'required',\n         'email'             =>          'required|email',\n         'phone'             =>          'required',\n         'address'           =>          'required',\n         'zipcode'           =>          'required',\n     ]);\n\n     $student['full_name']      =           $student['first_name'] . \" \".$student['last_name'];\n\n     Student::where('id', $id)->update($student);\n\n     return back()->with('success', 'Record updated successfully');\n    }\n<\/code><\/pre>\n\n\n\n<p>Here is the result after updating the record.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.programmingfields.com\/wp-content\/uploads\/2019\/09\/Student-Update.png?resize=805%2C642&#038;ssl=1\" alt=\"Update Record in Laravel 6\" class=\"wp-image-920\" width=\"805\" height=\"642\" srcset=\"https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Student-Update.png?w=805&amp;ssl=1 805w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Student-Update.png?resize=300%2C239&amp;ssl=1 300w, https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Student-Update.png?resize=768%2C612&amp;ssl=1 768w\" sizes=\"auto, (max-width: 805px) 100vw, 805px\" \/><figcaption>Update Student <\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Delete_Student_Record_in_Laravel_6_CRUD\"><\/span>Delete Student Record in Laravel 6 CRUD<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this step, the delete operation will be performed by the student id.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">\/\/ delete student\n\npublic function destroy($id)\n    {\n        $student = Student::findOrFail($id);\n        $student->delete();\n        return redirect('student')->with('success', 'Student deleted successfully');\n    }<\/code><\/pre>\n\n\n\n<div class=\"wp-block-button aligncenter\"><a class=\"wp-block-button__link has-text-color has-background\" href=\"https:\/\/www.programmingfields.com\/wp-content\/uploads\/2019\/09\/blog.zip\" style=\"background-color:#d0000e;color:#ffffff\"> Download Source <\/a><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this <strong>Laravel CRUD<\/strong> tutorial, I have tried to show you a very simple approach to work with the data in the Laravel 6 with MySQL database using Laravel 6 CRUD Example. Here, in this tutorial, I have shown you the step by step guide to create, read, update and delete the data using the Laravel 6 eloquent. I hope this will help you to implement the real projects in Laravel.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Laravel 6 CRUD application will contain the approach to create and use the Insert, Select, Update, and Delete functionalities. You can build your own advanced applications by using this concept in Laravel 6. Laravel has several inbuilt features that make it more secure, robust, and authentic to our application. Before moving to the Laravel 6 [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":928,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[2564],"tags":[555,556,558,559,557,504],"yst_prominent_words":[517,520,547,134,532,100,552,551,550,18,151,116,456,457,516,519,554,23,471,553],"class_list":{"0":"post-805","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-laravel","8":"tag-laravel-6-crud","9":"tag-laravel-6-crud-tutorial","10":"tag-laravel-6-eloquent","11":"tag-laravel-6-model","12":"tag-laravel-6-routing","13":"tag-laravel-composer-install","14":"entry"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/programmingfields.com\/wp-content\/uploads\/2019\/09\/Laravel-6-CRUD-Tutorial.png?fit=560%2C315&ssl=1","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/programmingfields.com\/wp-json\/wp\/v2\/posts\/805","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/programmingfields.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/programmingfields.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/programmingfields.com\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/programmingfields.com\/wp-json\/wp\/v2\/comments?post=805"}],"version-history":[{"count":1,"href":"https:\/\/programmingfields.com\/wp-json\/wp\/v2\/posts\/805\/revisions"}],"predecessor-version":[{"id":8687,"href":"https:\/\/programmingfields.com\/wp-json\/wp\/v2\/posts\/805\/revisions\/8687"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/programmingfields.com\/wp-json\/wp\/v2\/media\/928"}],"wp:attachment":[{"href":"https:\/\/programmingfields.com\/wp-json\/wp\/v2\/media?parent=805"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/programmingfields.com\/wp-json\/wp\/v2\/categories?post=805"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/programmingfields.com\/wp-json\/wp\/v2\/tags?post=805"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/programmingfields.com\/wp-json\/wp\/v2\/yst_prominent_words?post=805"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}