Laravel Quick Reference

Aus Carl-Christian Sautter - Wiki
Wechseln zu: Navigation, Suche

Tabelle erstellen:

php artisan make:migration create_usergroups_table --create=usergroups

Pfad für Tabellen erstellen Script:

/database/migrations

Seeder erstellen:

php artisan make:seeder UsersTableSeeder

Alle Tabellen und Seeds neu erstellen:

php artisan migrate:refresh
php artisan migrate:refresh --seed

Controller Erstellen

php artisan make:controller UserController

Eloquent Model Erstellen

php artisan make:model User

Bugs

php artisan migrate:rollback

Command:

php artisan migrate:rollback

Error:

[Symfony\Component\Debug\Exception\FatalThrowableError]   
Fatal error: Class 'MyClass' not found

Solution:

composer dump-autoload

Frontend view does not update after code change:

The problem could be the view cache. Simple clear the cache:

php artisan view:clear

Another Problem could be different times at the server and client system. (Check NTP Sync)