Laravel is a strong MVC PHP framework, designed for developers who need a simple and elegant toolkit to bring full- featured web operations. Laravel was created by Taylor Otwell.
This article will guide the developers who want to learn easily Laravel through some simple steps.
3 Steps to learn Laravel Easily:
Step 1: Download laravel and Authentication Screen SetupRun the following command to download Laravel Latest Vesrion -
- composer create-project laravel/laravel project-laravel
Atfer running the above command laravel project will be Downloaded in htdocs folder (Xampp)/ www folder (Wamp). then go in your project folder and run the following two command one by one to setup laravel default Authentication -
- composer require laravel/ui
- php artisan ui vue –auth
Install Laravel Form Collective:
- composer require laravelcollective/html
Step 2: Connect Laravel Project to Database
Step 3: Create View, Model & Controller File.
- Create Route in the web.php file
Route::resource('crud', 'App\Http\Controllers\SubjectController');
- Create View File
go to project folder and create a blade file in resources>views. Suppose this blade file name "crud.blade.php". Data will be appends in this file.
Content of view file:
- Create Model file
go to project folder and create a model file in app>Models. Suppose this Model file name "Subject.php". Subject related table entity and attribute will be defined here. model for users table will be automatically created while project downloaded. following command will generate the model file.
php artisan make:model Models\Subject
Content of Model file:
- Create Controller file
go to project folder and create a model file in app>Http>Controllers. Suppose this Controller file name "SubjectController.php". crud related table entity and attribute will be defined here. Following command will generate the controller file.
EmoticonEmoticon