add more controller
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Teachers;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class TeacherAssignmentResource extends JsonResource
|
||||
{
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
'teacher_id' => (int) ($this['teacher_id'] ?? 0),
|
||||
'firstname' => (string) ($this['firstname'] ?? ''),
|
||||
'lastname' => (string) ($this['lastname'] ?? ''),
|
||||
'name' => (string) ($this['name'] ?? ''),
|
||||
'email' => $this['email'] ?? null,
|
||||
'cellphone' => $this['cellphone'] ?? null,
|
||||
'role' => $this['role'] ?? null,
|
||||
'school_year' => $this['school_year'] ?? null,
|
||||
'main_assignments' => $this['main_assignments'] ?? [],
|
||||
'ta_assignments' => $this['ta_assignments'] ?? [],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user