-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.txt
37 lines (27 loc) · 1.21 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
delete unnecessary file from github:
git rm --cached -r database/database.sqlite
create controllers with command:
php artisan make:controller SomeController
create mysql database:
mysql -u root (-p password_if_present) #connects to the database
>create database db_name
>use db_name # focuses on the specified db
make migrations:
php artisan make:migration create_ideas_table (to set up a migration table)
php artisan migrate (to apply current migrations)
php artisan migrate:refresh (rolls down the changes and ups them again)
make mode: # with php artisan make you can check the methods
php artisan make:model Idea
make controller:
php artisan make:controller NameController -r (--resource defines the methods)
security stuff from Laravel:
protected $fillable must be assigned to models if we want a convenient Model instance creation
@csrf
random errors:
in form input tags id parameter can make problems so use name instead of id
controllers convention:
https://laravel.com/docs/11.x/controllers#actions-handled-by-resource-controllers
introduce new entity in the system:
php artisan make:model Comment -m -c (making the model first then migrations and then controller)
debugbar:
composer require barryvdh/laravel-debugbar --dev