File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 11# FirstLaravel
22
3+ ## Routes
4+
5+ ```
6+ Route::get('/posts', [PostsApiController::class, 'index']);
7+ Route::get('/post/{post}', [PostsApiController::class, 'get']);
8+ Route::post('/posts', [PostsApiController::class, 'store']);
9+ Route::put('/posts/{post}', [PostsApiController::class, 'update']);
10+ Route::delete('/posts/{post}', [PostsApiController::class, 'destroy']);
11+ ```
12+
13+ ### Laravel artisan commands
14+
15+ ```
16+ rm database/database.sqlite
17+ sqlite3 database/database.sqlite "create table aTable(field1 int); drop table aTable;"
18+ php artisan make:model Post -m
19+ php artisan migrate
20+ php artisan migrate:fresh
21+ php artisan migrate:status
22+ php artisan migrate:reset
23+ php artisan migrate:refresh
24+ php artisan migrate
25+ php artisan make:controller PostsApiController
26+ ```
27+
328### Insert fake/sample data to database
429
530** $ php artisan tinker**
You can’t perform that action at this time.
0 commit comments