Artisan Commands
Development Server
# Start the development server
./artisan serve
# Start with auto-reload enabled
./artisan serve --reload
Testing
Documentation
Database
# Create a new model (with optional migration)
./artisan make:model User --migration
# Create and run migrations
./artisan make:migration "create users table"
./artisan migrate
./artisan migrate:status
./artisan migrate:rollback
# Reset and refresh database
./artisan migrate:reset # Rollback all migrations
./artisan migrate:refresh # Rollback all and run all migrations
Database Seeding
Create a new seeder
This will create a new seeder file inapp/seeders/usersseeder.py with sample data. Run all seeders
This will run all seeders in theapp/seeders directory. Run specific seeder
This will run only the specified seeder.Refresh database and seed
This will: 1. Rollback all migrations 2. Run all migrations 3. Run all seedersCode Generation
# Create a new service
./artisan make:service UserService
# Create service with interface
./artisan make:service UserService --interface
# Create a new controller
./artisan make:controller User
# Create a new schema
./artisan make:schema User
# Create a new middleware
./artisan make:middleware Auth
# Create a new exception
./artisan make:exception NotFound
# Create a new validator
./artisan make:validator User
# Create a new repository
./artisan make:repository User
Maintenance
```bash
Generate a new application key
./artisan key:generate
Clear application cache
./artisan cache:clear
View application logs
./artisan logs:view
Clear application logs
./artisan logs:clear
Seed the database
./artisan seed