obsidian/MyObsidianVault/WebDev/2 CodeIgniter/_Course Notes/15.) Shield Auth+Project Controller.md

35 lines
675 B
Markdown
Raw Normal View History

2024-11-23 14:01:36 +01:00
```bash
php spark make:controller Api/Auth --suffix --restful
php spark make:controller Api/Project --suffix --restful
```
![[Pasted image 20241123100630.png]]
![[Pasted image 20241123100706.png]]
![[Pasted image 20241123100734.png]]
![[Pasted image 20241123100756.png]]
--- PROJECT CONTROLLER
![[Pasted image 20241123100834.png]]
![[Pasted image 20241123100851.png]]
![[Pasted image 20241123100913.png]]
ADD SHIELD USERMODEL
![[Pasted image 20241123101019.png]]
```bash
php spark make:model Project --suffix
```
extend allowedFields, e.g.
```php
$allowedFields = ["user_id","name"]
```
Add Project Model to ProjectController
```php
use App\Models\ProjectModel;
```