##laravel
logging in laravel
tail -n0 -F storage/logs/laravel.log
add use Log;
above the class then use Log::info('check this var =' . $var);
install laravel
composer create-project laravel/laravel laravelapp
create controller
php artisan make:controller PagesController
create model with migration
php artisan make:model Post -m
run migration
php artisan migrate
To generate a seeder, execute the make:seeder Artisan command. All seeders generated by the framework will be placed in the database/seeds directory:
php artisan make:seeder UsersTableSeeder
To run db seed
composer dump-autoload && php artisan db:seed or php artisan db:seed --class=UsersTableSeeder // for specific table seeder
compile assets to public
npm run dev
compile assets and watch for changes during dev
npm run watch
Start mailhog
sudo service mailhog restart
Run scheduler/laravel cron
while true; do php artisan schedule:run; sleep 60; done
post-deploy steps
- composer dump-autoload
- composer install --no-interaction --prefer-dist --optimize-autoloader
- php artisan migrate
- php artisan migrate --path=/database/migrations/selected-to-deploy/ # for new migrations
- php artisan config:clear
- php artisan view:clear
use the below if needed
- php artisan cache:clear
- php artisan route:clear
- php artisan db:seed
- php artisan db:seed --class=DatabaseSeeder