In this article, you’ll be using Laravel 7 for building a CRUD example application with a MySQL database and Bootstrap 4.

Introducing Database CRUD?

CRUD stands for Create, Read, Update and Delete which are operations needed in most data-driven apps that access and work with data from a database.

In this example, we’ll be learning how to make the CRUD operations in Laravel 7 with a MySQL database.

_Also read: _Laravel 7/6 REST CRUD API Tutorial — Build a CRM [PART 1]: Eloquent Models and Relationships

What Are the New Features of Laravel 7?

Laravel 7 has various new features such as:

  • Laravel Airlock: An official package for API authentication,
  • Custom Eloquent Casts: They allow you add your won custom casts,
  • CORS support by default i.e without third-party plugins,
  • Blade Component Tags & Improvements Allows you to create class-less components,
  • HTTP Client: An API for making HTTP requests,
  • Route Caching Speed Improvements, etc.

Installing and Creating a Laravel 7 Project

In this part, we’ll learn what Laravel is and we’ll install and create a new Laravel 7 project.

What is Laravel?

Laravel docs describe it as:

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as:

You can initialize a Laravel 7 project from your command-line interface, using the following command:

$ composer create-project  --prefer-dist  laravel/laravel laravel-7-crud-app

This will install laravel/laravel v7.

Note: Make sure you have PHP 7.2.5+ installed on your system. Otherwise, composer will use a previous version of Laravel for your project.

You can verify the installed version in your project using:

$ cd laravel-7-crud-app
$ php artisan -V
Laravel Framework 7

Installing the Front-End Dependencies

In your generated project, you can see that a package.json file is generated which includes many front-end libraries that can be used by your project:

  • axios,
  • bootstrap,
  • cross-env,
  • jquery,
  • laravel-mix,
  • lodash,
  • popper.js,
  • resolve-url-loader,
  • sass,
  • sass-loader,
  • vue.

Note: You can use your preferred libraries with Laravel not specifically the ones added to _package.json_.

The _package.json_ file in your Laravel project includes a few packages such as _vue_ and _axios_ to help you get started building your JavaScript application.

It also includes _bootstrap_ to help you get started with Bootstrap for styling your UI.

It include Laravel Mix to help you compile your SASS files to plain CSS.

You need to use npm to install the front-end dependencies:

$ npm install

After running this command a node_modules folder will be created and the dependencies will be installed into it.

Note: You need to have Node.js and npm installed on your system before you can install the front-end dependencies.

#laravel #mysql #laravel-framework #php

Laravel 7 CRUD Tutorial: Build a CRUD App with MySQL and Bootstrap 4
37.30 GEEK