Laravel: Unterschied zwischen den Versionen

Aus Vokabulabor
Zur Navigation springen Zur Suche springen
Zeile 16: Zeile 16:
   -e "s/DB_USERNAME=.*/DB_USERNAME=$PROJ" \
   -e "s/DB_USERNAME=.*/DB_USERNAME=$PROJ" \
   -e "s/DB_PASSWORD=.*/DB_USERNAME=$PASSWD" .env
   -e "s/DB_PASSWORD=.*/DB_USERNAME=$PASSWD" .env
</syntaxhighlight>
= Install Laravel-Breeze (Authentification) =
<syntaxhighlight lang="bash">
composer require laravel/breeze --dev
php artisan breeze:install blade
php artisan migrate
</syntaxhighlight>
</syntaxhighlight>


Zeile 22: Zeile 29:
npm install
npm install
npm run dev
npm run dev
</syntaxhighlight>
= Artisan Tipps =
<syntaxhighlight lang="bash">
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
</syntaxhighlight>
= Integrierter Webserver =
<syntaxhighlight lang="bash">
php artisan serve
</syntaxhighlight>
</syntaxhighlight>

Version vom 28. Oktober 2023, 19:20 Uhr

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