Laravel

Aus Vokabulabor
Zur Navigation springen Zur Suche springen

Links

Projekt einrichten

PROJ=langutor
PASSW=topsecret
BASE=/home/ws/php/$PROJ
cd $(basename $BASE)
composer create-project laravel/laravel $PROJ
cd $BASE
composer require laravel/ui
composer require spatie/laravel-permission
php artisan ui bootstrap --auth
dbtool create-db-and-user lrv$PROJ $PROJ "$PASSW"
sed -i -e "s/DB_DATABASE=.*/DB_DATABASE=lrv$PROJ" \
  -e "s/DB_USERNAME=.*/DB_USERNAME=$PROJ" \
  -e "s/DB_PASSWORD=.*/DB_USERNAME=$PASSWD" .env

Install Laravel-Breeze (Authentification)

composer require laravel/breeze --dev
php artisan breeze:install blade
php artisan migrate

Projekt aktualisieren

npm install
npm run dev

Artisan Tipps

php artisan make:seeder PermissionSeeder
php artisan migrate:fresh --seed
php artisan make:controller RoleController --resource
php artisan make:request StoreRoleRequest
php artisan make:view users.index

Integrierter Webserver

php artisan serve