In this article, you’ll be using Laravel 7 for building a CRUD example application with a MySQL database and Bootstrap 4.
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
Laravel 7 has various new features such as:
In this part, we’ll learn what Laravel is and we’ll install and create a new Laravel 7 project.
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
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:
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