This commit is contained in:
Torsten 2024-12-08 09:19:03 +01:00
parent a9e7afd13a
commit ba3de1ae99
31 changed files with 329 additions and 5 deletions

View file

@ -0,0 +1,36 @@
https://www.youtube.com/watch?v=4_MdtVqfH1o&list=PLT9miexWCpPW6Z_OXNv2d78cqCrZaPrVG&index=9
```bash
php spark make:model Student --suffix
```
Creates StudentModel.php in app/Models
Add allowedFields
![[Pasted image 20241113082554.png]]
Add Model to Controller
![[Pasted image 20241113082703.png]]
![[Pasted image 20241113083139.png]]
add to routes
```php
$routes->get("add-student", "StudentController::insertStudent");
```
update example (condition, data):
![[Pasted image 20241113083603.png]]
delete:
![[Pasted image 20241113083823.png]]
get all :
![[Pasted image 20241113084056.png]]
get single with generic condition:
![[Pasted image 20241113084645.png]]