Laravel commands

Laravel commands

Laravel Core commands

Core Commands

PHP artisan make:model [ModelName]

Create a database table model class. Models use to interact with products, people, and orders in databases.

PHP artisan make:controller [ControllerName]

Create a controller class. Use controllers to handle user input and logins and profile updates. 

 PHP artisan make:request [RequestName] 

 Create a form-request validation class. Validate user registration input using concise, reusable form validation logic.


Core Commands save you from writing boilerplate code by setting up your application's major components:


Migration Commands

php artisan migrate

Apply all pending migrations to update database schema. Create database modifications, such as adding tables or altering columns, without manually writing SQL . 

php artisan migrate:fresh

Drop all tables and retry migrations.In development, reset your database to start over with testing or schema rebuilding. 

php artisan db:seed

 Database seeders add sample data to tables. Create sample users or goods to test in your database.

php artisan migrate:rollback

Remove a freshly formed table during testing to undo database schema changes. 

php artisan migrate --path=database/migrations/0001_01_01_000001_create_cache_table.php

Run Specific Migration / file

php artisan make:model Tutorial_Groups --migration

Create Model class along with  migration class file

 

Author
Full Stack Developer

Deepak Talwar

Technical Architect & Full Stack Developer with 18+ years of Professional Experience in Microsoft Technologies & PHP Platform. Hands on experience with C#, VB, ASP.NET, ASP.NET MVC, ASP.NET Core, ASP.NET Web API, Linq, ADO.NET, Entity Framework, Entity Framework Core, Sql Server, MYSQL, NoSql, Javascript, Angular, jQuery, AWS, Azure, React, Angular, Laravel, Codeingiter, Serenity, VBA, Cloud Computing, Microservices, Design Patterns, Software Architecture, Web Design and Development.

Related Post