Skip to content

Commit 26e10a1

Browse files
committed
2 parents 8504825 + e153a75 commit 26e10a1

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
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**

0 commit comments

Comments
 (0)