Laravel CRUD tutorial

Development environment

  1. Windows 10
  2. XAMPP (for MySql is running)
  3. Clone or download this code this code

Step by Step

  1. Create database named as laravel_tutorial
  2. Edit environments (.env)
  1. create model BlogPost with migration script
php artisan make:model BlogPost --migration
  1. edit migration script
        Schema::create('blog_posts', function (Blueprint $table) {
  1. Run migrations
php artisan migrate
  1. Create Controller
php artisan make:controller BlogPostController --resource --model=BlogPost
  1. Update the blank method (refer to the code) in BlogPostController
  2. Run php artisan serve

Source Code