composer create-project laravel/laravel hello
cd hello && npm install
php artisan serve
Add packages to project:
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init
Create postcss configuration file touch postcss.config.js
and put this inside:
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
}
}
Add SASS and tailwind forms plugin:
npm install -D sass sass-loader @tailwindcss/forms
Edit tailwind.config.js
to look like this:
/** @type {import('tailwindcss').Config} */
export default {
content: [
"./resources/**/*.{php,js}",
],
theme: {
container: {
center: true,
},
extend: {},
},
plugins: [
require('@tailwindcss/forms'),
],
}
Generate a regular controller
php artisan make:controller AuthController
Generate a resource controller for model (model will be created if not exists)
php artisan make:controller UserController --resource --model=User
php artisan make:provider AssetManagerProvider
Generate application and database model (-m
switch will also generate a migration file).
php artisan make:model Blog -m
php artisan make:mail WebsiteContact
Create migration
php artisan make:migration create_flights_table
Run database migrations
php artisan migrate
Rollback migrations
php artisan migrate:rollback
Create seeder class
php artisan make:seeder UserSeeder
Run specific seeder class
php artisan db:seed --class=UserSeeder
Run all seeder classes
php artisan db:seed