fix unittests issues
API CI/CD / Validate (composer + pint) (push) Successful in 3m6s
API CI/CD / Test (PHPUnit) (push) Failing after 4m53s
API CI/CD / Build frontend assets (push) Successful in 1m2s
API CI/CD / Security audit (push) Failing after 59s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
API CI/CD / Validate (composer + pint) (push) Successful in 3m6s
API CI/CD / Test (PHPUnit) (push) Failing after 4m53s
API CI/CD / Build frontend assets (push) Successful in 1m2s
API CI/CD / Security audit (push) Failing after 59s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
This commit is contained in:
@@ -245,8 +245,23 @@ class RolePermissionController extends BaseApiController
|
|||||||
|
|
||||||
public function updateRolePermissions(RolePermissionUpdateRequest $request, int $roleId): JsonResponse
|
public function updateRolePermissions(RolePermissionUpdateRequest $request, int $roleId): JsonResponse
|
||||||
{
|
{
|
||||||
|
$payload = $request->validated();
|
||||||
|
$permissions = $payload['permissions'] ?? null;
|
||||||
|
if ($permissions === null && isset($payload['permission_ids'])) {
|
||||||
|
$permissions = [];
|
||||||
|
foreach ((array) $payload['permission_ids'] as $permissionId) {
|
||||||
|
$permissions[(int) $permissionId] = [
|
||||||
|
'create' => true,
|
||||||
|
'read' => true,
|
||||||
|
'update' => true,
|
||||||
|
'delete' => true,
|
||||||
|
'manage' => true,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->permissionService->saveRolePermissions($roleId, $request->validated()['permissions'] ?? []);
|
$this->permissionService->saveRolePermissions($roleId, $permissions ?? []);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
Log::error('Role permissions update failed: '.$e->getMessage());
|
Log::error('Role permissions update failed: '.$e->getMessage());
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class PreferencesController extends BaseApiController
|
|||||||
|
|
||||||
return $this->success([
|
return $this->success([
|
||||||
'preferences' => new PreferencesResource($payload['preferences']),
|
'preferences' => new PreferencesResource($payload['preferences']),
|
||||||
], 'Preferences saved.', $saved->wasRecentlyCreated ? Response::HTTP_CREATED : Response::HTTP_OK);
|
], 'Preferences saved.');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateForUser(PreferencesUpsertRequest $request, int $userId): JsonResponse
|
public function updateForUser(PreferencesUpsertRequest $request, int $userId): JsonResponse
|
||||||
@@ -113,18 +113,18 @@ class PreferencesController extends BaseApiController
|
|||||||
|
|
||||||
return $this->success([
|
return $this->success([
|
||||||
'preferences' => new PreferencesResource($payload['preferences']),
|
'preferences' => new PreferencesResource($payload['preferences']),
|
||||||
], 'Preferences saved.', $saved->wasRecentlyCreated ? Response::HTTP_CREATED : Response::HTTP_OK);
|
], 'Preferences saved.');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function destroy(int $userId): JsonResponse
|
public function destroy(int $userId): JsonResponse
|
||||||
{
|
{
|
||||||
$row = Preferences::query()->where('user_id', $userId)->first();
|
$row = Preferences::query()->where('user_id', $userId)->first();
|
||||||
|
$this->authorize('delete', $row ?? new Preferences(['user_id' => $userId]));
|
||||||
|
|
||||||
if (! $row) {
|
if (! $row) {
|
||||||
return $this->error('Preferences not found.', Response::HTTP_NOT_FOUND);
|
return $this->error('Preferences not found.', Response::HTTP_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->authorize('delete', $row);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$deleted = $this->commandService->delete($row);
|
$deleted = $this->commandService->delete($row);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
|
|||||||
@@ -79,7 +79,15 @@ class NavBuilderController extends BaseApiController
|
|||||||
$this->authorize('manage', NavItem::class);
|
$this->authorize('manage', NavItem::class);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->builderService->reorder($request->validated()['orders']);
|
$payload = $request->validated();
|
||||||
|
$orders = $payload['orders'] ?? [];
|
||||||
|
if ($orders === [] && isset($payload['items'])) {
|
||||||
|
foreach ((array) $payload['items'] as $item) {
|
||||||
|
$orders[(int) $item['id']] = (int) $item['sort_order'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->builderService->reorder($orders);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
Log::error('Nav reorder failed: '.$e->getMessage());
|
Log::error('Nav reorder failed: '.$e->getMessage());
|
||||||
|
|
||||||
|
|||||||
@@ -33,13 +33,14 @@ class EnsureParentProgressAccess
|
|||||||
->map(fn ($name) => strtolower((string) $name))
|
->map(fn ($name) => strtolower((string) $name))
|
||||||
->toArray();
|
->toArray();
|
||||||
|
|
||||||
if (in_array('parent', $roles, true)) {
|
$userType = strtolower(trim((string) ($user->user_type ?? '')));
|
||||||
|
|
||||||
|
if (in_array('parent', $roles, true) || $userType === 'primary') {
|
||||||
$request->attributes->set('primary_parent_id', (int) $user->id);
|
$request->attributes->set('primary_parent_id', (int) $user->id);
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
|
|
||||||
$userType = strtolower(trim((string) ($user->user_type ?? '')));
|
|
||||||
if (in_array($userType, ['secondary', 'tertiary'], true)) {
|
if (in_array($userType, ['secondary', 'tertiary'], true)) {
|
||||||
/** @var PrimaryParentUserResolver $resolver */
|
/** @var PrimaryParentUserResolver $resolver */
|
||||||
$resolver = app(PrimaryParentUserResolver::class);
|
$resolver = app(PrimaryParentUserResolver::class);
|
||||||
|
|||||||
@@ -14,13 +14,15 @@ class RolePermissionUpdateRequest extends ApiFormRequest
|
|||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'permissions' => ['required', 'array'],
|
'permissions' => ['required_without:permission_ids', 'array'],
|
||||||
'permissions.*' => ['array'],
|
'permissions.*' => ['array'],
|
||||||
'permissions.*.create' => ['nullable', 'boolean'],
|
'permissions.*.create' => ['nullable', 'boolean'],
|
||||||
'permissions.*.read' => ['nullable', 'boolean'],
|
'permissions.*.read' => ['nullable', 'boolean'],
|
||||||
'permissions.*.update' => ['nullable', 'boolean'],
|
'permissions.*.update' => ['nullable', 'boolean'],
|
||||||
'permissions.*.delete' => ['nullable', 'boolean'],
|
'permissions.*.delete' => ['nullable', 'boolean'],
|
||||||
'permissions.*.manage' => ['nullable', 'boolean'],
|
'permissions.*.manage' => ['nullable', 'boolean'],
|
||||||
|
'permission_ids' => ['required_without:permissions', 'array'],
|
||||||
|
'permission_ids.*' => ['integer', 'exists:permissions,id'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,8 +14,11 @@ class NavItemReorderRequest extends ApiFormRequest
|
|||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'orders' => ['required', 'array'],
|
'orders' => ['required_without:items', 'array'],
|
||||||
'orders.*' => ['integer'],
|
'orders.*' => ['integer'],
|
||||||
|
'items' => ['required_without:orders', 'array'],
|
||||||
|
'items.*.id' => ['required_with:items', 'integer', 'min:1'],
|
||||||
|
'items.*.sort_order' => ['required_with:items', 'integer'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ class AttendanceData extends BaseModel
|
|||||||
'school_id' => 'integer',
|
'school_id' => 'integer',
|
||||||
'student_id' => 'integer',
|
'student_id' => 'integer',
|
||||||
'modified_by' => 'integer',
|
'modified_by' => 'integer',
|
||||||
'date' => 'datetime', // ✅ DATETIME column
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/* =========================
|
/* =========================
|
||||||
@@ -57,8 +56,8 @@ class AttendanceData extends BaseModel
|
|||||||
private static function dayRange(string $day): array
|
private static function dayRange(string $day): array
|
||||||
{
|
{
|
||||||
$day = substr($day, 0, 10); // YYYY-MM-DD
|
$day = substr($day, 0, 10); // YYYY-MM-DD
|
||||||
$start = Carbon::parse($day)->startOfDay();
|
$start = $day;
|
||||||
$endEx = Carbon::parse($day)->addDay()->startOfDay(); // exclusive
|
$endEx = Carbon::parse($day)->addDay()->toDateString(); // exclusive
|
||||||
|
|
||||||
return [$start, $endEx];
|
return [$start, $endEx];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,20 +11,7 @@ class AttendanceRecord extends BaseModel
|
|||||||
// ✅ legacy uses created_at / updated_at
|
// ✅ legacy uses created_at / updated_at
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['class_section_id', 'student_id', 'school_id', 'total_absence', 'total_late', 'total_presence', 'total_attendance', 'semester', 'school_year', 'modified_by', 'created_at', 'updated_at'];
|
||||||
'class_section_id',
|
|
||||||
'student_id',
|
|
||||||
'school_id',
|
|
||||||
'total_absence',
|
|
||||||
'total_late',
|
|
||||||
'total_presence',
|
|
||||||
'total_attendance',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'modified_by',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'class_section_id' => 'integer',
|
'class_section_id' => 'integer',
|
||||||
|
|||||||
@@ -12,17 +12,7 @@ class AttendanceTracking extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['student_id', 'date', 'is_reported', 'reason', 'note', 'is_notified', 'notif_counter', 'semester', 'school_year', 'created_at', 'updated_at'];
|
||||||
'student_id',
|
|
||||||
'date',
|
|
||||||
'is_reported',
|
|
||||||
'reason',
|
|
||||||
'is_notified',
|
|
||||||
'notif_counter',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'note',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'student_id' => 'integer',
|
'student_id' => 'integer',
|
||||||
|
|||||||
@@ -9,20 +9,7 @@ class AuthorizedUser extends BaseModel
|
|||||||
// ✅ auto-manage created_at / updated_at
|
// ✅ auto-manage created_at / updated_at
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['user_id', 'authorized_user_id', 'firstname', 'lastname', 'phone_number', 'gender', 'email', 'relation_to_user', 'token', 'status', 'created_at', 'updated_at'];
|
||||||
'user_id',
|
|
||||||
'authorized_user_id',
|
|
||||||
'firstname',
|
|
||||||
'lastname',
|
|
||||||
'phone_number',
|
|
||||||
'gender',
|
|
||||||
'email',
|
|
||||||
'relation_to_user',
|
|
||||||
'token',
|
|
||||||
'status',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'user_id' => 'integer',
|
'user_id' => 'integer',
|
||||||
|
|||||||
@@ -13,15 +13,7 @@ class BadgePrintLog extends BaseModel
|
|||||||
// legacy: useTimestamps = false
|
// legacy: useTimestamps = false
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['user_id', 'printed_by', 'school_year', 'printed_at', 'role', 'class_section_name', 'copies'];
|
||||||
'user_id',
|
|
||||||
'printed_by',
|
|
||||||
'school_year',
|
|
||||||
'printed_at',
|
|
||||||
'role',
|
|
||||||
'class_section_name',
|
|
||||||
'copies',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'user_id' => 'integer',
|
'user_id' => 'integer',
|
||||||
|
|||||||
@@ -2,4 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
class Calendar extends CalendarEvent {}
|
class Calendar extends CalendarEvent
|
||||||
|
{
|
||||||
|
protected $fillable = ['title', 'date', 'description', 'notify_parent', 'notify_admin', 'notify_teacher', 'no_school', 'semester', 'school_year', 'notification_sent', 'created_at', 'updated_at'];
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,16 +6,9 @@ class ClassPrepAdjustment extends BaseModel
|
|||||||
{
|
{
|
||||||
protected $table = 'class_prep_adjustments';
|
protected $table = 'class_prep_adjustments';
|
||||||
|
|
||||||
// legacy model didn't use timestamps; keep off unless your table has updated_at/created_at auto-managed.
|
public $timestamps = false;
|
||||||
public $timestamps = true;
|
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['class_section_id', 'item_name', 'adjustment', 'adjustable', 'school_year', 'created_at'];
|
||||||
'class_section_id',
|
|
||||||
'item_name',
|
|
||||||
'adjustment',
|
|
||||||
'school_year',
|
|
||||||
'created_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'class_section_id' => 'integer',
|
'class_section_id' => 'integer',
|
||||||
|
|||||||
@@ -6,16 +6,9 @@ class ClassPreparationLog extends BaseModel
|
|||||||
{
|
{
|
||||||
protected $table = 'class_preparation_log';
|
protected $table = 'class_preparation_log';
|
||||||
|
|
||||||
// legacy: useTimestamps = false
|
public $timestamps = false;
|
||||||
public $timestamps = true;
|
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['class_section_id', 'class_section', 'school_year', 'prep_data', 'created_at'];
|
||||||
'class_section_id',
|
|
||||||
'class_section',
|
|
||||||
'school_year',
|
|
||||||
'prep_data',
|
|
||||||
'created_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'class_section_id' => 'integer',
|
'class_section_id' => 'integer',
|
||||||
|
|||||||
@@ -13,14 +13,7 @@ class ClassProgressAttachment extends BaseModel
|
|||||||
// legacy: useTimestamps = false
|
// legacy: useTimestamps = false
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['report_id', 'file_path', 'original_name', 'mime_type', 'file_size', 'created_at'];
|
||||||
'report_id',
|
|
||||||
'file_path',
|
|
||||||
'original_name',
|
|
||||||
'mime_type',
|
|
||||||
'file_size',
|
|
||||||
'created_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'report_id' => 'integer',
|
'report_id' => 'integer',
|
||||||
|
|||||||
@@ -13,26 +13,7 @@ class ClassProgressReport extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['class_section_id', 'teacher_id', 'week_start', 'week_end', 'subject', 'unit_title', 'materials', 'covered', 'homework', 'assessment', 'status', 'status_notes', 'class_notes', 'next_week_plan', 'support_needed', 'flags_json', 'attachment_path', 'created_at', 'updated_at'];
|
||||||
'class_section_id',
|
|
||||||
'teacher_id',
|
|
||||||
'school_year',
|
|
||||||
'semester',
|
|
||||||
'week_start',
|
|
||||||
'week_end',
|
|
||||||
'subject',
|
|
||||||
'unit_title',
|
|
||||||
'covered',
|
|
||||||
'homework',
|
|
||||||
'assessment',
|
|
||||||
'status',
|
|
||||||
'status_notes',
|
|
||||||
'class_notes',
|
|
||||||
'next_week_plan',
|
|
||||||
'support_needed',
|
|
||||||
'flags_json',
|
|
||||||
'attachment_path',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'class_section_id' => 'integer',
|
'class_section_id' => 'integer',
|
||||||
|
|||||||
@@ -15,13 +15,7 @@ class ClassSection extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true
|
// ✅ legacy: useTimestamps = true
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['class_id', 'class_section_id', 'class_section_name', 'created_at', 'updated_at', 'semester', 'school_year'];
|
||||||
'class_id',
|
|
||||||
'class_section_id',
|
|
||||||
'class_section_name',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'class_id' => 'integer',
|
'class_id' => 'integer',
|
||||||
|
|||||||
@@ -7,24 +7,9 @@ class CommunicationLog extends BaseModel
|
|||||||
protected $table = 'communication_logs';
|
protected $table = 'communication_logs';
|
||||||
|
|
||||||
// legacy model didn't enable timestamps; keep off unless your table has created_at/updated_at.
|
// legacy model didn't enable timestamps; keep off unless your table has created_at/updated_at.
|
||||||
public $timestamps = true;
|
public $timestamps = false;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['student_id', 'family_id', 'student_name', 'template_key', 'subject', 'body', 'recipients', 'cc', 'bcc', 'attachments', 'status', 'error_message', 'sent_by', 'metadata'];
|
||||||
'student_id',
|
|
||||||
'family_id',
|
|
||||||
'student_name',
|
|
||||||
'template_key',
|
|
||||||
'subject',
|
|
||||||
'body',
|
|
||||||
'recipients',
|
|
||||||
'cc',
|
|
||||||
'bcc',
|
|
||||||
'attachments',
|
|
||||||
'status',
|
|
||||||
'error_message',
|
|
||||||
'sent_by',
|
|
||||||
'metadata',
|
|
||||||
];
|
|
||||||
|
|
||||||
public function getFillable(): array
|
public function getFillable(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,22 +14,7 @@ class Competition extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at) + deleted_at for soft deletes
|
// ✅ legacy: useTimestamps = true (created_at/updated_at) + deleted_at for soft deletes
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['title', 'semester', 'school_year', 'class_section_id', 'start_date', 'end_date', 'winners_count', 'prize_per_point', 'is_published', 'published_at', 'created_by', 'created_at', 'updated_at', 'deleted_at', 'is_locked', 'locked_at', 'locked_by'];
|
||||||
'title',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'class_section_id',
|
|
||||||
'start_date',
|
|
||||||
'end_date',
|
|
||||||
'winners_count',
|
|
||||||
'prize_per_point',
|
|
||||||
'is_published',
|
|
||||||
'published_at',
|
|
||||||
'is_locked',
|
|
||||||
'locked_at',
|
|
||||||
'locked_by',
|
|
||||||
'created_by',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'class_section_id' => 'integer',
|
'class_section_id' => 'integer',
|
||||||
|
|||||||
@@ -9,18 +9,7 @@ class CompetitionClassWinner extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['competition_id', 'class_section_id', 'winners_override', 'created_at', 'updated_at', 'question_count', 'prize_1', 'prize_2', 'prize_3', 'prize_4', 'prize_5', 'prize_6'];
|
||||||
'competition_id',
|
|
||||||
'class_section_id',
|
|
||||||
'winners_override',
|
|
||||||
'question_count',
|
|
||||||
'prize_1',
|
|
||||||
'prize_2',
|
|
||||||
'prize_3',
|
|
||||||
'prize_4',
|
|
||||||
'prize_5',
|
|
||||||
'prize_6',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'competition_id' => 'integer',
|
'competition_id' => 'integer',
|
||||||
|
|||||||
@@ -9,13 +9,7 @@ class CompetitionScore extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['competition_id', 'student_id', 'class_section_id', 'score', 'notes', 'created_at', 'updated_at'];
|
||||||
'competition_id',
|
|
||||||
'student_id',
|
|
||||||
'class_section_id',
|
|
||||||
'score',
|
|
||||||
'notes',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'competition_id' => 'integer',
|
'competition_id' => 'integer',
|
||||||
|
|||||||
@@ -9,15 +9,7 @@ class CompetitionWinner extends BaseModel
|
|||||||
// legacy: useTimestamps = false
|
// legacy: useTimestamps = false
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['competition_id', 'student_id', 'class_section_id', 'rank', 'score', 'prize_amount', 'created_at'];
|
||||||
'competition_id',
|
|
||||||
'student_id',
|
|
||||||
'class_section_id',
|
|
||||||
'rank',
|
|
||||||
'score',
|
|
||||||
'prize_amount',
|
|
||||||
'created_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'competition_id' => 'integer',
|
'competition_id' => 'integer',
|
||||||
|
|||||||
@@ -12,10 +12,7 @@ class Configuration extends BaseModel
|
|||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
public $incrementing = true;
|
public $incrementing = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['config_key', 'config_value'];
|
||||||
'config_key',
|
|
||||||
'config_value',
|
|
||||||
];
|
|
||||||
|
|
||||||
/* =========================
|
/* =========================
|
||||||
* legacy method equivalents
|
* legacy method equivalents
|
||||||
|
|||||||
@@ -9,16 +9,7 @@ class ContactUs extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['sender_id', 'reciever_id', 'subject', 'message', 'created_at', 'updated_at', 'semester', 'school_year'];
|
||||||
'sender_id',
|
|
||||||
'reciever_id',
|
|
||||||
'subject',
|
|
||||||
'message',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'sender_id' => 'integer',
|
'sender_id' => 'integer',
|
||||||
|
|||||||
@@ -10,25 +10,7 @@ class CurrentFlag extends BaseModel
|
|||||||
// you can enable auto-management. If your table does NOT actually have them, set false.
|
// you can enable auto-management. If your table does NOT actually have them, set false.
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['student_id', 'student_name', 'grade', 'flag', 'flag_datetime', 'flag_state', 'updated_by_open', 'open_description', 'updated_by_closed', 'close_description', 'action_taken', 'updated_by_canceled', 'cancel_description', 'semester', 'school_year', 'created_at', 'updated_at'];
|
||||||
'student_id',
|
|
||||||
'student_name',
|
|
||||||
'grade',
|
|
||||||
'flag',
|
|
||||||
'flag_datetime',
|
|
||||||
'flag_state',
|
|
||||||
'updated_by_open',
|
|
||||||
'open_description',
|
|
||||||
'updated_by_closed',
|
|
||||||
'close_description',
|
|
||||||
'action_taken',
|
|
||||||
'updated_by_canceled',
|
|
||||||
'cancel_description',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'student_id' => 'integer',
|
'student_id' => 'integer',
|
||||||
|
|||||||
@@ -11,16 +11,7 @@ class DiscountUsage extends BaseModel
|
|||||||
// ✅ legacy: timestamps enabled (created_at / updated_at)
|
// ✅ legacy: timestamps enabled (created_at / updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['voucher_id', 'invoice_id', 'parent_id', 'discount_amount', 'description', 'school_year', 'updated_by', 'used_at', 'created_at', 'updated_at', 'semester'];
|
||||||
'voucher_id',
|
|
||||||
'invoice_id',
|
|
||||||
'discount_amount',
|
|
||||||
'school_year',
|
|
||||||
'semester',
|
|
||||||
'updated_by',
|
|
||||||
'parent_id',
|
|
||||||
'used_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'voucher_id' => 'integer',
|
'voucher_id' => 'integer',
|
||||||
|
|||||||
@@ -11,21 +11,7 @@ class DiscountVoucher extends BaseModel
|
|||||||
// ✅ legacy manages created_at / updated_at
|
// ✅ legacy manages created_at / updated_at
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['code', 'discount_type', 'description', 'discount_value', 'max_uses', 'times_used', 'valid_from', 'valid_until', 'is_active', 'created_at', 'updated_at', 'school_year', 'semester'];
|
||||||
'code',
|
|
||||||
'discount_type',
|
|
||||||
'discount_value',
|
|
||||||
'max_uses',
|
|
||||||
'times_used',
|
|
||||||
'valid_from',
|
|
||||||
'valid_until',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'is_active',
|
|
||||||
'description',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'discount_value' => 'decimal:2',
|
'discount_value' => 'decimal:2',
|
||||||
|
|||||||
@@ -9,16 +9,7 @@ class EarlyDismissalSignature extends BaseModel
|
|||||||
// ✅ legacy: timestamps enabled (created_at/updated_at)
|
// ✅ legacy: timestamps enabled (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['report_date', 'school_year', 'semester', 'filename', 'original_name', 'mime_type', 'file_size', 'uploaded_by', 'created_at', 'updated_at'];
|
||||||
'report_date',
|
|
||||||
'school_year',
|
|
||||||
'semester',
|
|
||||||
'filename',
|
|
||||||
'original_name',
|
|
||||||
'mime_type',
|
|
||||||
'file_size',
|
|
||||||
'uploaded_by',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
// report_date is stored as Y-m-d in legacy validation; keep as date
|
// report_date is stored as Y-m-d in legacy validation; keep as date
|
||||||
|
|||||||
@@ -9,17 +9,7 @@ class EmergencyContact extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['emergency_contact_name', 'parent_id', 'cellphone', 'email', 'relation', 'semester', 'school_year', 'created_at', 'updated_at'];
|
||||||
'parent_id',
|
|
||||||
'emergency_contact_name',
|
|
||||||
'cellphone',
|
|
||||||
'email',
|
|
||||||
'relation',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'parent_id' => 'integer',
|
'parent_id' => 'integer',
|
||||||
|
|||||||
@@ -11,20 +11,7 @@ class Enrollment extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true
|
// ✅ legacy: useTimestamps = true
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['student_id', 'class_section_id', 'parent_id', 'enrollment_date', 'enrollment_status', 'withdrawal_date', 'is_withdrawn', 'admission_status', 'semester', 'school_year', 'created_at', 'updated_at'];
|
||||||
'student_id',
|
|
||||||
'class_section_id',
|
|
||||||
'parent_id',
|
|
||||||
'school_year',
|
|
||||||
'enrollment_date',
|
|
||||||
'enrollment_status',
|
|
||||||
'withdrawal_date',
|
|
||||||
'is_withdrawn',
|
|
||||||
'admission_status',
|
|
||||||
'semester',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'student_id' => 'integer',
|
'student_id' => 'integer',
|
||||||
|
|||||||
+1
-13
@@ -9,19 +9,7 @@ class Event extends BaseModel
|
|||||||
// ✅ legacy: timestamps enabled (created_at/updated_at)
|
// ✅ legacy: timestamps enabled (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['event_name', 'event_category', 'description', 'amount', 'flyer', 'expiration_date', 'semester', 'school_year', 'created_by', 'created_at', 'updated_at'];
|
||||||
'event_name',
|
|
||||||
'event_category',
|
|
||||||
'description',
|
|
||||||
'amount',
|
|
||||||
'flyer',
|
|
||||||
'expiration_date',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'created_by',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'amount' => 'decimal:2', // adjust precision if needed
|
'amount' => 'decimal:2', // adjust precision if needed
|
||||||
|
|||||||
@@ -11,33 +11,7 @@ class EventCharges extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['event_id', 'parent_id', 'student_id', 'participation', 'charged', 'semester', 'school_year', 'updated_by', 'created_at', 'updated_at'];
|
||||||
'event_id',
|
|
||||||
'event_name',
|
|
||||||
'description',
|
|
||||||
'amount',
|
|
||||||
'parent_id',
|
|
||||||
'student_id',
|
|
||||||
'participation',
|
|
||||||
'charged',
|
|
||||||
'waiver_signed',
|
|
||||||
'event_paid',
|
|
||||||
'event_payment_id',
|
|
||||||
'class_section_id',
|
|
||||||
'external_firstname',
|
|
||||||
'external_lastname',
|
|
||||||
'external_note',
|
|
||||||
'external_parent_firstname',
|
|
||||||
'external_parent_lastname',
|
|
||||||
'external_parent_phone',
|
|
||||||
'external_parent_email',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'created_by',
|
|
||||||
'updated_by',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'event_id' => 'integer',
|
'event_id' => 'integer',
|
||||||
|
|||||||
+2
-8
@@ -13,17 +13,11 @@ class Exam extends BaseModel
|
|||||||
*
|
*
|
||||||
* We'll keep auto created_at, no updated_at:
|
* We'll keep auto created_at, no updated_at:
|
||||||
*/
|
*/
|
||||||
public $timestamps = true;
|
public $timestamps = false;
|
||||||
|
|
||||||
const UPDATED_AT = null; // ✅ no updated_at column
|
const UPDATED_AT = null; // ✅ no updated_at column
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['student_id', 'student_school_id', 'class_section_id', 'exam_name', 'created_at'];
|
||||||
'student_id',
|
|
||||||
'school_id',
|
|
||||||
'class_section_id',
|
|
||||||
'exam_name',
|
|
||||||
'created_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'student_id' => 'integer',
|
'student_id' => 'integer',
|
||||||
|
|||||||
@@ -9,36 +9,7 @@ class ExamDraft extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['teacher_id', 'class_section_id', 'semester', 'school_year', 'exam_type', 'draft_title', 'description', 'teacher_file', 'teacher_filename', 'status', 'admin_id', 'admin_comments', 'reviewed_at', 'final_file', 'final_filename', 'version', 'previous_draft_id', 'is_legacy', 'created_at', 'updated_at'];
|
||||||
'teacher_id',
|
|
||||||
'author_id',
|
|
||||||
'class_section_id',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'exam_type',
|
|
||||||
'draft_title',
|
|
||||||
'author_comment',
|
|
||||||
'description',
|
|
||||||
'teacher_file',
|
|
||||||
'teacher_filename',
|
|
||||||
'author_file',
|
|
||||||
'author_filename',
|
|
||||||
'status',
|
|
||||||
'acceptance_type',
|
|
||||||
'review_revision',
|
|
||||||
'reviewer_id',
|
|
||||||
'admin_id',
|
|
||||||
'is_legacy',
|
|
||||||
'reviewer_comment',
|
|
||||||
'reviewer_comments',
|
|
||||||
'admin_comments',
|
|
||||||
'reviewed_at',
|
|
||||||
'final_file',
|
|
||||||
'final_filename',
|
|
||||||
'final_pdf_file',
|
|
||||||
'version',
|
|
||||||
'previous_draft_id',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'teacher_id' => 'integer',
|
'teacher_id' => 'integer',
|
||||||
|
|||||||
+1
-17
@@ -11,23 +11,7 @@ class Expense extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['category', 'amount', 'receipt_path', 'description', 'retailor', 'purchased_by', 'date_of_purchase', 'added_by', 'created_at', 'updated_at', 'school_year', 'semester', 'status', 'status_reason', 'updated_by', 'approved_by', 'reimbursement_id'];
|
||||||
'category',
|
|
||||||
'amount',
|
|
||||||
'receipt_path',
|
|
||||||
'description',
|
|
||||||
'retailor',
|
|
||||||
'date_of_purchase',
|
|
||||||
'purchased_by',
|
|
||||||
'added_by',
|
|
||||||
'school_year',
|
|
||||||
'semester',
|
|
||||||
'status',
|
|
||||||
'status_reason',
|
|
||||||
'reimbursement_id',
|
|
||||||
'approved_by',
|
|
||||||
'updated_by',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'amount' => 'decimal:2', // adjust precision if needed
|
'amount' => 'decimal:2', // adjust precision if needed
|
||||||
|
|||||||
+1
-14
@@ -9,20 +9,7 @@ class Family extends BaseModel
|
|||||||
// legacy model didn't specify timestamps
|
// legacy model didn't specify timestamps
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['family_code', 'household_name', 'address_line1', 'address_line2', 'city', 'state', 'postal_code', 'country', 'primary_phone', 'preferred_lang', 'preferred_contact_method', 'is_active', 'created_at', 'updated_at'];
|
||||||
'family_code',
|
|
||||||
'household_name',
|
|
||||||
'address_line1',
|
|
||||||
'address_line2',
|
|
||||||
'city',
|
|
||||||
'state',
|
|
||||||
'postal_code',
|
|
||||||
'country',
|
|
||||||
'primary_phone',
|
|
||||||
'preferred_lang',
|
|
||||||
'preferred_contact_method',
|
|
||||||
'is_active',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'is_active' => 'boolean',
|
'is_active' => 'boolean',
|
||||||
|
|||||||
@@ -9,13 +9,7 @@ class FamilyCommPref extends BaseModel
|
|||||||
// legacy model didn't specify timestamps
|
// legacy model didn't specify timestamps
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['family_id', 'category', 'via_email', 'via_sms', 'cc_all_guardians', 'created_at', 'updated_at'];
|
||||||
'family_id',
|
|
||||||
'category',
|
|
||||||
'via_email',
|
|
||||||
'via_sms',
|
|
||||||
'cc_all_guardians',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'family_id' => 'integer',
|
'family_id' => 'integer',
|
||||||
|
|||||||
@@ -9,15 +9,7 @@ class FamilyGuardian extends BaseModel
|
|||||||
// legacy model didn't specify timestamps
|
// legacy model didn't specify timestamps
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['family_id', 'user_id', 'relation', 'is_primary', 'receive_emails', 'receive_sms', 'custody_notes', 'created_at', 'updated_at'];
|
||||||
'family_id',
|
|
||||||
'user_id',
|
|
||||||
'relation',
|
|
||||||
'is_primary',
|
|
||||||
'receive_emails',
|
|
||||||
'receive_sms',
|
|
||||||
'custody_notes',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'family_id' => 'integer',
|
'family_id' => 'integer',
|
||||||
|
|||||||
@@ -11,12 +11,7 @@ class FamilyStudent extends BaseModel
|
|||||||
// legacy model didn't specify timestamps
|
// legacy model didn't specify timestamps
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['family_id', 'student_id', 'is_primary_home', 'notes', 'created_at', 'updated_at'];
|
||||||
'family_id',
|
|
||||||
'student_id',
|
|
||||||
'is_primary_home',
|
|
||||||
'notes',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'family_id' => 'integer',
|
'family_id' => 'integer',
|
||||||
|
|||||||
@@ -10,25 +10,9 @@ class FinalExam extends BaseModel
|
|||||||
* legacy: useTimestamps = false (even though table has created_at/updated_at fields).
|
* legacy: useTimestamps = false (even though table has created_at/updated_at fields).
|
||||||
* So we keep timestamps OFF and you can set created_at/updated_at manually if needed.
|
* So we keep timestamps OFF and you can set created_at/updated_at manually if needed.
|
||||||
*/
|
*/
|
||||||
public $timestamps = false;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['student_id', 'school_id', 'class_section_id', 'updated_by', 'score', 'semester', 'school_year', 'created_at', 'updated_at'];
|
||||||
'student_id',
|
|
||||||
'school_id',
|
|
||||||
'class_section_id',
|
|
||||||
'updated_by',
|
|
||||||
'score',
|
|
||||||
'max_points',
|
|
||||||
'status',
|
|
||||||
'excused_reason',
|
|
||||||
'locked_at',
|
|
||||||
'locked_by',
|
|
||||||
'comment',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'student_id' => 'integer',
|
'student_id' => 'integer',
|
||||||
|
|||||||
@@ -10,19 +10,7 @@ class FinalScore extends BaseModel
|
|||||||
// If you want Laravel to auto-manage them, keep true (recommended).
|
// If you want Laravel to auto-manage them, keep true (recommended).
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['student_id', 'school_id', 'class_section_id', 'updated_by', 'score', 'score_letter', 'comment', 'school_year', 'created_at', 'updated_at', 'semester'];
|
||||||
'student_id',
|
|
||||||
'school_id',
|
|
||||||
'class_section_id',
|
|
||||||
'teacher_id',
|
|
||||||
'score',
|
|
||||||
'score_letter',
|
|
||||||
'comment',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'student_id' => 'integer',
|
'student_id' => 'integer',
|
||||||
|
|||||||
@@ -9,16 +9,7 @@ class GradingLock extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true
|
// ✅ legacy: useTimestamps = true
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['class_section_id', 'semester', 'school_year', 'is_locked', 'locked_by', 'locked_at', 'created_at', 'updated_at'];
|
||||||
'class_section_id',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'is_locked',
|
|
||||||
'locked_by',
|
|
||||||
'locked_at',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'class_section_id' => 'integer',
|
'class_section_id' => 'integer',
|
||||||
|
|||||||
+2
-19
@@ -12,26 +12,9 @@ class Homework extends BaseModel
|
|||||||
* legacy: useTimestamps = false (even though created_at/updated_at columns exist).
|
* legacy: useTimestamps = false (even though created_at/updated_at columns exist).
|
||||||
* Keep it OFF to match behavior. If you want Laravel to auto-manage, tell me.
|
* Keep it OFF to match behavior. If you want Laravel to auto-manage, tell me.
|
||||||
*/
|
*/
|
||||||
public $timestamps = false;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['student_id', 'school_id', 'class_section_id', 'updated_by', 'homework_index', 'score', 'comment', 'semester', 'school_year', 'created_at', 'updated_at'];
|
||||||
'student_id',
|
|
||||||
'school_id',
|
|
||||||
'class_section_id',
|
|
||||||
'updated_by',
|
|
||||||
'homework_index',
|
|
||||||
'score',
|
|
||||||
'max_points',
|
|
||||||
'status',
|
|
||||||
'excused_reason',
|
|
||||||
'locked_at',
|
|
||||||
'locked_by',
|
|
||||||
'comment',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'student_id' => 'integer',
|
'student_id' => 'integer',
|
||||||
|
|||||||
+1
-19
@@ -9,25 +9,7 @@ class Incident extends BaseModel
|
|||||||
// Table contains created_at/updated_at; enable auto timestamps (recommended).
|
// Table contains created_at/updated_at; enable auto timestamps (recommended).
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['student_id', 'student_name', 'grade', 'incident', 'incident_datetime', 'incident_state', 'updated_by_open', 'open_description', 'updated_by_closed', 'close_description', 'action_taken', 'updated_by_canceled', 'cancel_description', 'semester', 'school_year', 'created_at', 'updated_at'];
|
||||||
'student_id',
|
|
||||||
'student_name',
|
|
||||||
'grade',
|
|
||||||
'incident',
|
|
||||||
'incident_datetime',
|
|
||||||
'incident_state',
|
|
||||||
'updated_by_open',
|
|
||||||
'open_description',
|
|
||||||
'updated_by_closed',
|
|
||||||
'close_description',
|
|
||||||
'action_taken',
|
|
||||||
'updated_by_canceled',
|
|
||||||
'cancel_description',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'student_id' => 'integer',
|
'student_id' => 'integer',
|
||||||
|
|||||||
@@ -9,15 +9,7 @@ class InventoryCategory extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['type', 'name', 'description', 'grade_min', 'grade_max', 'created_at', 'updated_at'];
|
||||||
'type',
|
|
||||||
'name',
|
|
||||||
'description',
|
|
||||||
'grade_min',
|
|
||||||
'grade_max',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'grade_min' => 'integer',
|
'grade_min' => 'integer',
|
||||||
|
|||||||
@@ -9,37 +9,7 @@ class InventoryItem extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true
|
// ✅ legacy: useTimestamps = true
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['type', 'category_id', 'name', 'description', 'quantity', 'good_qty', 'needs_repair_qty', 'need_replace_qty', 'cannot_find_qty', 'unit', 'condition', 'isbn', 'edition', 'sku', 'notes', 'semester', 'school_year', 'updated_by', 'created_at', 'updated_at'];
|
||||||
'type',
|
|
||||||
'category_id',
|
|
||||||
'name',
|
|
||||||
'description',
|
|
||||||
'quantity',
|
|
||||||
'unit',
|
|
||||||
'condition',
|
|
||||||
'isbn',
|
|
||||||
'edition',
|
|
||||||
'sku',
|
|
||||||
'notes',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'updated_by',
|
|
||||||
'good_qty',
|
|
||||||
'needs_repair_qty',
|
|
||||||
'need_replace_qty',
|
|
||||||
'cannot_find_qty',
|
|
||||||
// Supplier/reorder fields
|
|
||||||
'preferred_supplier_id',
|
|
||||||
'last_purchase_price',
|
|
||||||
'average_unit_cost',
|
|
||||||
'reorder_point',
|
|
||||||
'reorder_quantity',
|
|
||||||
'lead_time_days',
|
|
||||||
// Barcode/QR fields
|
|
||||||
'barcode',
|
|
||||||
'qr_code',
|
|
||||||
'asset_tag',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'category_id' => 'integer',
|
'category_id' => 'integer',
|
||||||
|
|||||||
@@ -9,26 +9,7 @@ class InventoryMovement extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['item_id', 'qty_change', 'movement_type', 'reason', 'note', 'semester', 'school_year', 'performed_by', 'teacher_id', 'student_id', 'class_section_id', 'created_at', 'updated_at'];
|
||||||
'item_id',
|
|
||||||
'qty_change',
|
|
||||||
'movement_type',
|
|
||||||
'reason',
|
|
||||||
'note',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'performed_by',
|
|
||||||
'teacher_id',
|
|
||||||
'student_id',
|
|
||||||
'class_section_id',
|
|
||||||
// Audit/correction fields
|
|
||||||
'voided_at',
|
|
||||||
'voided_by',
|
|
||||||
'void_reason',
|
|
||||||
'corrects_movement_id',
|
|
||||||
'source_type',
|
|
||||||
'source_id',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'item_id' => 'integer',
|
'item_id' => 'integer',
|
||||||
|
|||||||
+2
-18
@@ -13,25 +13,9 @@ class Invoice extends BaseModel
|
|||||||
* legacy: useTimestamps = false because DB defaults/triggers manage created_at/updated_at.
|
* legacy: useTimestamps = false because DB defaults/triggers manage created_at/updated_at.
|
||||||
* In Laravel, keep timestamps OFF and let DB handle them.
|
* In Laravel, keep timestamps OFF and let DB handle them.
|
||||||
*/
|
*/
|
||||||
public $timestamps = false;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['parent_id', 'invoice_number', 'total_amount', 'balance', 'paid_amount', 'has_discount', 'issue_date', 'due_date', 'status', 'description', 'school_year', 'created_at', 'updated_at', 'updated_by', 'semester'];
|
||||||
'parent_id',
|
|
||||||
'invoice_number',
|
|
||||||
'total_amount',
|
|
||||||
'school_year',
|
|
||||||
'semester',
|
|
||||||
'balance',
|
|
||||||
'paid_amount',
|
|
||||||
'has_discount',
|
|
||||||
'issue_date',
|
|
||||||
'due_date',
|
|
||||||
'status',
|
|
||||||
'description',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
'updated_by',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'parent_id' => 'integer',
|
'parent_id' => 'integer',
|
||||||
|
|||||||
@@ -9,17 +9,7 @@ class InvoiceEvent extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['invoice_id', 'event_name', 'description', 'amount', 'semester', 'school_year', 'updated_by', 'created_at', 'updated_at'];
|
||||||
'invoice_id',
|
|
||||||
'event_name',
|
|
||||||
'description',
|
|
||||||
'amount',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'updated_by',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'invoice_id' => 'integer',
|
'invoice_id' => 'integer',
|
||||||
|
|||||||
@@ -9,18 +9,7 @@ class InvoiceStudentList extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['invoice_id', 'student_id', 'student_firstname', 'student_lastname', 'school_id', 'enrolled', 'school_year', 'created_at', 'updated_at', 'semester'];
|
||||||
'invoice_id',
|
|
||||||
'student_id',
|
|
||||||
'student_firstname',
|
|
||||||
'student_lastname',
|
|
||||||
'school_id',
|
|
||||||
'enrolled',
|
|
||||||
'school_year',
|
|
||||||
'semester',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'invoice_id' => 'integer',
|
'invoice_id' => 'integer',
|
||||||
|
|||||||
@@ -9,14 +9,7 @@ class IpAttempt extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['ip_address', 'attempts', 'last_attempt_at', 'blocked_until', 'created_at', 'updated_at', 'school_year', 'semester'];
|
||||||
'ip_address',
|
|
||||||
'attempts',
|
|
||||||
'last_attempt_at',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'blocked_until',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'attempts' => 'integer',
|
'attempts' => 'integer',
|
||||||
|
|||||||
@@ -12,18 +12,7 @@ class LateSlipLog extends BaseModel
|
|||||||
// legacy: useTimestamps = false (printed_at is controlled explicitly)
|
// legacy: useTimestamps = false (printed_at is controlled explicitly)
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['school_year', 'semester', 'student_name', 'slip_date', 'time_in', 'grade', 'reason', 'admin_name', 'printed_by', 'printed_at'];
|
||||||
'school_year',
|
|
||||||
'semester',
|
|
||||||
'student_name',
|
|
||||||
'slip_date',
|
|
||||||
'time_in',
|
|
||||||
'grade',
|
|
||||||
'reason',
|
|
||||||
'admin_name',
|
|
||||||
'printed_by',
|
|
||||||
'printed_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'printed_by' => 'integer',
|
'printed_by' => 'integer',
|
||||||
|
|||||||
@@ -9,18 +9,7 @@ class LoginActivity extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['user_id', 'email', 'login_time', 'logout_time', 'ip_address', 'user_agent', 'created_at', 'updated_at', 'semester', 'school_year'];
|
||||||
'user_id',
|
|
||||||
'email',
|
|
||||||
'login_time',
|
|
||||||
'logout_time',
|
|
||||||
'ip_address',
|
|
||||||
'user_agent',
|
|
||||||
'school_year',
|
|
||||||
'semester',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'user_id' => 'integer',
|
'user_id' => 'integer',
|
||||||
|
|||||||
@@ -9,16 +9,7 @@ class ManualPayment extends BaseModel
|
|||||||
// legacy: useTimestamps = false
|
// legacy: useTimestamps = false
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['invoice_number', 'amount', 'payment_method', 'reference', 'discount_number', 'proof_path', 'created_at', 'school_year', 'semester'];
|
||||||
'invoice_number',
|
|
||||||
'amount',
|
|
||||||
'payment_method',
|
|
||||||
'reference',
|
|
||||||
'proof_path',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'created_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'amount' => 'decimal:2', // adjust precision if needed
|
'amount' => 'decimal:2', // adjust precision if needed
|
||||||
|
|||||||
+1
-15
@@ -9,21 +9,7 @@ class Message extends BaseModel
|
|||||||
// legacy: useTimestamps = false (manual date fields)
|
// legacy: useTimestamps = false (manual date fields)
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['sender_id', 'recipient_id', 'subject', 'message', 'sent_datetime', 'read_status', 'read_datetime', 'message_number', 'priority', 'attachment', 'status', 'semester', 'school_year'];
|
||||||
'sender_id',
|
|
||||||
'recipient_id',
|
|
||||||
'subject',
|
|
||||||
'message',
|
|
||||||
'sent_datetime',
|
|
||||||
'read_status',
|
|
||||||
'read_datetime',
|
|
||||||
'message_number',
|
|
||||||
'priority',
|
|
||||||
'attachment',
|
|
||||||
'status',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'sender_id' => 'integer',
|
'sender_id' => 'integer',
|
||||||
|
|||||||
@@ -10,25 +10,9 @@ class MidtermExam extends BaseModel
|
|||||||
* legacy: useTimestamps = false (even though created_at/updated_at columns exist).
|
* legacy: useTimestamps = false (even though created_at/updated_at columns exist).
|
||||||
* Keep it OFF to match behavior (you can still store created_at/updated_at manually).
|
* Keep it OFF to match behavior (you can still store created_at/updated_at manually).
|
||||||
*/
|
*/
|
||||||
public $timestamps = false;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['student_id', 'school_id', 'class_section_id', 'updated_by', 'score', 'comment', 'semester', 'school_year', 'created_at', 'updated_at'];
|
||||||
'student_id',
|
|
||||||
'school_id',
|
|
||||||
'class_section_id',
|
|
||||||
'updated_by',
|
|
||||||
'score',
|
|
||||||
'max_points',
|
|
||||||
'status',
|
|
||||||
'excused_reason',
|
|
||||||
'locked_at',
|
|
||||||
'locked_by',
|
|
||||||
'comment',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'student_id' => 'integer',
|
'student_id' => 'integer',
|
||||||
|
|||||||
@@ -11,18 +11,7 @@ class MissingScoreOverride extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['student_id', 'class_section_id', 'semester', 'school_year', 'item_type', 'item_index', 'is_allowed', 'updated_by', 'created_at', 'updated_at'];
|
||||||
'student_id',
|
|
||||||
'class_section_id',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'item_type',
|
|
||||||
'item_index',
|
|
||||||
'is_allowed',
|
|
||||||
'updated_by',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'student_id' => 'integer',
|
'student_id' => 'integer',
|
||||||
|
|||||||
@@ -13,15 +13,7 @@ class NavItem extends BaseModel
|
|||||||
|
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['menu_parent_id', 'label', 'url', 'icon_class', 'target', 'sort_order', 'is_enabled', 'created_at', 'updated_at', 'deleted_at'];
|
||||||
'menu_parent_id',
|
|
||||||
'label',
|
|
||||||
'url',
|
|
||||||
'icon_class',
|
|
||||||
'target',
|
|
||||||
'sort_order',
|
|
||||||
'is_enabled',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'menu_parent_id' => 'integer',
|
'menu_parent_id' => 'integer',
|
||||||
|
|||||||
@@ -14,19 +14,7 @@ class Notification extends BaseModel
|
|||||||
|
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['title', 'message', 'target_group', 'delivery_channels', 'priority', 'status', 'action_url', 'attachment_path', 'scheduled_at', 'sent_at', 'expires_at', 'created_at', 'updated_at', 'deleted_at', 'school_year', 'semester'];
|
||||||
'title',
|
|
||||||
'message',
|
|
||||||
'target_group',
|
|
||||||
'delivery_channels',
|
|
||||||
'priority',
|
|
||||||
'status',
|
|
||||||
'action_url',
|
|
||||||
'attachment_path',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'scheduled_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'scheduled_at' => 'datetime',
|
'scheduled_at' => 'datetime',
|
||||||
|
|||||||
@@ -11,25 +11,12 @@ class ParentAttendanceReport extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true
|
// ✅ legacy: useTimestamps = true
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['parent_id', 'student_id', 'class_section_id', 'report_date', 'type', 'arrival_time', 'dismiss_time', 'reason', 'semester', 'school_year', 'status', 'created_at', 'updated_at'];
|
||||||
'parent_id',
|
|
||||||
'student_id',
|
|
||||||
'class_section_id',
|
|
||||||
'report_date',
|
|
||||||
'type',
|
|
||||||
'arrival_time',
|
|
||||||
'dismiss_time',
|
|
||||||
'reason',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'status',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'parent_id' => 'integer',
|
'parent_id' => 'integer',
|
||||||
'student_id' => 'integer',
|
'student_id' => 'integer',
|
||||||
'class_section_id' => 'integer',
|
'class_section_id' => 'integer',
|
||||||
'report_date' => 'date',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/* Optional relationships */
|
/* Optional relationships */
|
||||||
|
|||||||
@@ -9,20 +9,7 @@ class ParentMeetingSchedule extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['student_id', 'parent_user_id', 'parent_name', 'student_name', 'class_section_name', 'date', 'time', 'notes', 'semester', 'school_year', 'status', 'created_by', 'created_at', 'updated_at'];
|
||||||
'student_id',
|
|
||||||
'parent_user_id',
|
|
||||||
'parent_name',
|
|
||||||
'student_name',
|
|
||||||
'class_section_name',
|
|
||||||
'date',
|
|
||||||
'time',
|
|
||||||
'notes',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'status',
|
|
||||||
'created_by',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'student_id' => 'integer',
|
'student_id' => 'integer',
|
||||||
|
|||||||
@@ -9,16 +9,7 @@ class ParentModel extends BaseModel
|
|||||||
// legacy model didn't specify timestamps
|
// legacy model didn't specify timestamps
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['secondparent_firstname', 'secondparent_lastname', 'secondparent_gender', 'secondparent_email', 'secondparent_phone', 'firstparent_id', 'secondparent_id', 'semester', 'school_year', 'created_at', 'updated_at'];
|
||||||
'secondparent_firstname',
|
|
||||||
'secondparent_lastname',
|
|
||||||
'secondparent_gender',
|
|
||||||
'secondparent_email',
|
|
||||||
'secondparent_phone',
|
|
||||||
'firstparent_id',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'firstparent_id' => 'integer',
|
'firstparent_id' => 'integer',
|
||||||
|
|||||||
@@ -9,18 +9,7 @@ class ParentNotification extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['student_id', 'code', 'incident_date', 'channel', 'to_address', 'subject', 'status', 'response', 'semester', 'school_year', 'created_at', 'updated_at'];
|
||||||
'student_id',
|
|
||||||
'code',
|
|
||||||
'incident_date',
|
|
||||||
'channel',
|
|
||||||
'to_address',
|
|
||||||
'subject',
|
|
||||||
'status',
|
|
||||||
'response',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'student_id' => 'integer',
|
'student_id' => 'integer',
|
||||||
|
|||||||
@@ -10,25 +10,9 @@ class Participation extends BaseModel
|
|||||||
* legacy: useTimestamps = false (even though created_at/updated_at columns exist).
|
* legacy: useTimestamps = false (even though created_at/updated_at columns exist).
|
||||||
* Keep OFF to match behavior (you can still set created_at/updated_at manually).
|
* Keep OFF to match behavior (you can still set created_at/updated_at manually).
|
||||||
*/
|
*/
|
||||||
public $timestamps = false;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['student_id', 'school_id', 'class_section_id', 'updated_by', 'score', 'comment', 'semester', 'school_year', 'created_at', 'updated_at'];
|
||||||
'student_id',
|
|
||||||
'school_id',
|
|
||||||
'class_section_id',
|
|
||||||
'updated_by',
|
|
||||||
'score',
|
|
||||||
'max_points',
|
|
||||||
'status',
|
|
||||||
'excused_reason',
|
|
||||||
'locked_at',
|
|
||||||
'locked_by',
|
|
||||||
'comment',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'student_id' => 'integer',
|
'student_id' => 'integer',
|
||||||
|
|||||||
@@ -18,18 +18,13 @@ class PasswordReset extends BaseModel
|
|||||||
* This will auto-set expires_at whenever you call save()/update().
|
* This will auto-set expires_at whenever you call save()/update().
|
||||||
* (Only do this if that’s truly what you want.)
|
* (Only do this if that’s truly what you want.)
|
||||||
*/
|
*/
|
||||||
public $timestamps = true;
|
public $timestamps = false;
|
||||||
|
|
||||||
const CREATED_AT = 'created_at';
|
const CREATED_AT = 'created_at';
|
||||||
|
|
||||||
const UPDATED_AT = 'expires_at';
|
const UPDATED_AT = 'expires_at';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['email', 'token', 'created_at', 'expires_at'];
|
||||||
'email',
|
|
||||||
'token',
|
|
||||||
'created_at',
|
|
||||||
'expires_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'created_at' => 'datetime',
|
'created_at' => 'datetime',
|
||||||
|
|||||||
@@ -7,12 +7,9 @@ class PasswordResetRequest extends BaseModel
|
|||||||
protected $table = 'password_reset_requests';
|
protected $table = 'password_reset_requests';
|
||||||
|
|
||||||
// legacy: timestamps off
|
// legacy: timestamps off
|
||||||
public $timestamps = true;
|
public $timestamps = false;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['ip_address', 'requested_at'];
|
||||||
'ip_address',
|
|
||||||
'requested_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'requested_at' => 'datetime',
|
'requested_at' => 'datetime',
|
||||||
|
|||||||
@@ -10,30 +10,11 @@ class PayPalPayment extends BaseModel
|
|||||||
* legacy: created_at is managed, updated_at is NOT used.
|
* legacy: created_at is managed, updated_at is NOT used.
|
||||||
* In Laravel: enable timestamps but disable UPDATED_AT.
|
* In Laravel: enable timestamps but disable UPDATED_AT.
|
||||||
*/
|
*/
|
||||||
public $timestamps = true;
|
public $timestamps = false;
|
||||||
|
|
||||||
const UPDATED_AT = null;
|
const UPDATED_AT = null;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['webhook_id', 'parent_school_id', 'order_id', 'transaction_id', 'status', 'amount', 'currency', 'paypal_fee', 'net_amount', 'payer_email', 'merchant_id', 'event_type', 'summary', 'raw_payload', 'synced', 'sync_attempts', 'created_at'];
|
||||||
'webhook_id',
|
|
||||||
'parent_school_id',
|
|
||||||
'order_id',
|
|
||||||
'transaction_id',
|
|
||||||
'status',
|
|
||||||
'amount',
|
|
||||||
'currency',
|
|
||||||
'paypal_fee',
|
|
||||||
'net_amount',
|
|
||||||
'payer_email',
|
|
||||||
'merchant_id',
|
|
||||||
'event_type',
|
|
||||||
'summary',
|
|
||||||
'raw_payload',
|
|
||||||
'synced',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'sync_attempts',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'parent_school_id' => 'integer',
|
'parent_school_id' => 'integer',
|
||||||
|
|||||||
+2
-18
@@ -12,25 +12,9 @@ class Payment extends BaseModel
|
|||||||
* legacy: useTimestamps = false because DB handles created_at/updated_at (defaults/triggers).
|
* legacy: useTimestamps = false because DB handles created_at/updated_at (defaults/triggers).
|
||||||
* Keep OFF in Laravel too.
|
* Keep OFF in Laravel too.
|
||||||
*/
|
*/
|
||||||
public $timestamps = false;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['parent_id', 'invoice_id', 'total_amount', 'paid_amount', 'balance', 'number_of_installments', 'transaction_id', 'check_file', 'check_number', 'payment_method', 'payment_date', 'semester', 'school_year', 'status', 'updated_by', 'created_at', 'updated_at'];
|
||||||
'parent_id',
|
|
||||||
'invoice_id',
|
|
||||||
'total_amount',
|
|
||||||
'paid_amount',
|
|
||||||
'balance',
|
|
||||||
'number_of_installments',
|
|
||||||
'transaction_id',
|
|
||||||
'check_file',
|
|
||||||
'check_number',
|
|
||||||
'payment_method',
|
|
||||||
'payment_date',
|
|
||||||
'school_year',
|
|
||||||
'semester',
|
|
||||||
'status',
|
|
||||||
'updated_by',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'parent_id' => 'integer',
|
'parent_id' => 'integer',
|
||||||
|
|||||||
@@ -9,19 +9,7 @@ class PaymentError extends BaseModel
|
|||||||
// legacy: useTimestamps = false (logged_at managed manually)
|
// legacy: useTimestamps = false (logged_at managed manually)
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['payment_id', 'invoice_id', 'parent_id', 'wrong_paid_amount', 'wrong_payment_method', 'wrong_check_file', 'error_note', 'logged_at', 'logged_by', 'school_year', 'semester'];
|
||||||
'payment_id',
|
|
||||||
'invoice_id',
|
|
||||||
'parent_id',
|
|
||||||
'wrong_paid_amount',
|
|
||||||
'wrong_payment_method',
|
|
||||||
'wrong_check_file',
|
|
||||||
'error_note',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'logged_at',
|
|
||||||
'logged_by',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'payment_id' => 'integer',
|
'payment_id' => 'integer',
|
||||||
|
|||||||
@@ -9,24 +9,7 @@ class PaymentNotificationLog extends BaseModel
|
|||||||
// legacy: useTimestamps = false (created_at / sent_at are managed manually)
|
// legacy: useTimestamps = false (created_at / sent_at are managed manually)
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['parent_id', 'invoice_id', 'school_year', 'period_year', 'period_month', 'type', 'to_email', 'cc_email', 'head_fa_notified', 'subject', 'body', 'status', 'error_message', 'balance_snapshot', 'created_at', 'sent_at'];
|
||||||
'parent_id',
|
|
||||||
'invoice_id',
|
|
||||||
'school_year',
|
|
||||||
'period_year',
|
|
||||||
'period_month',
|
|
||||||
'type',
|
|
||||||
'to_email',
|
|
||||||
'cc_email',
|
|
||||||
'head_fa_notified',
|
|
||||||
'subject',
|
|
||||||
'body',
|
|
||||||
'status',
|
|
||||||
'error_message',
|
|
||||||
'balance_snapshot',
|
|
||||||
'created_at',
|
|
||||||
'sent_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'parent_id' => 'integer',
|
'parent_id' => 'integer',
|
||||||
|
|||||||
@@ -9,21 +9,7 @@ class PaymentTransaction extends BaseModel
|
|||||||
// Legacy table has no created_at/updated_at columns.
|
// Legacy table has no created_at/updated_at columns.
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['transaction_id', 'payment_id', 'transaction_date', 'amount', 'payment_method', 'payment_status', 'transaction_fee', 'school_year', 'semester'];
|
||||||
'transaction_id',
|
|
||||||
'payment_id',
|
|
||||||
'transaction_date',
|
|
||||||
'amount',
|
|
||||||
'payment_method',
|
|
||||||
'payment_status',
|
|
||||||
'transaction_fee',
|
|
||||||
'payment_reference',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'is_full_payment',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'payment_id' => 'integer',
|
'payment_id' => 'integer',
|
||||||
|
|||||||
@@ -9,22 +9,7 @@ class PaypalTransaction extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['transaction_id', 'payment_id', 'firstname', 'lastname', 'event_type', 'payer_email', 'amount', 'currency', 'status', 'payment_method', 'transaction_fee', 'raw_data', 'created_at', 'updated_at', 'school_year', 'semester'];
|
||||||
'transaction_id',
|
|
||||||
'payment_id',
|
|
||||||
'firstname',
|
|
||||||
'lastname',
|
|
||||||
'event_type',
|
|
||||||
'payer_email',
|
|
||||||
'amount',
|
|
||||||
'currency',
|
|
||||||
'status',
|
|
||||||
'payment_method',
|
|
||||||
'transaction_fee',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'raw_data',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'payment_id' => 'integer',
|
'payment_id' => 'integer',
|
||||||
|
|||||||
@@ -12,12 +12,7 @@ class Permission extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['name', 'description', 'created_at', 'updated_at'];
|
||||||
'name',
|
|
||||||
'description',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
/* =========================
|
/* =========================
|
||||||
* legacy method equivalents
|
* legacy method equivalents
|
||||||
|
|||||||
@@ -9,14 +9,7 @@ class PlacementBatch extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['placement_test', 'school_year', 'created_by', 'updated_by', 'created_at', 'updated_at'];
|
||||||
'placement_test',
|
|
||||||
'school_year',
|
|
||||||
'created_by',
|
|
||||||
'updated_by',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'created_by' => 'integer',
|
'created_by' => 'integer',
|
||||||
|
|||||||
@@ -9,15 +9,7 @@ class PlacementLevel extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['student_id', 'level', 'school_year', 'created_by', 'updated_by', 'created_at', 'updated_at'];
|
||||||
'student_id',
|
|
||||||
'level',
|
|
||||||
'school_year',
|
|
||||||
'created_by',
|
|
||||||
'updated_by',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'student_id' => 'integer',
|
'student_id' => 'integer',
|
||||||
|
|||||||
@@ -9,15 +9,7 @@ class PlacementScore extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['batch_id', 'student_id', 'score', 'created_by', 'updated_by', 'created_at', 'updated_at'];
|
||||||
'batch_id',
|
|
||||||
'student_id',
|
|
||||||
'score',
|
|
||||||
'created_by',
|
|
||||||
'updated_by',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'batch_id' => 'integer',
|
'batch_id' => 'integer',
|
||||||
|
|||||||
@@ -9,27 +9,7 @@ class Preferences extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['user_id', 'notification_email', 'notification_sms', 'theme', 'language', 'style_color', 'menu_color', 'menu_custom_bg', 'menu_custom_text', 'menu_custom_mode', 'created_at', 'updated_at'];
|
||||||
'user_id',
|
|
||||||
'receive_email_notifications',
|
|
||||||
'receive_sms_notifications',
|
|
||||||
'theme',
|
|
||||||
'language',
|
|
||||||
'timezone',
|
|
||||||
'style_color',
|
|
||||||
'menu_color',
|
|
||||||
'custom',
|
|
||||||
'menu_custom_bg',
|
|
||||||
'menu_custom_text',
|
|
||||||
'menu_custom_mode',
|
|
||||||
'receive_push_notifications',
|
|
||||||
'daily_summary_email',
|
|
||||||
'privacy_mode',
|
|
||||||
'marketing_emails',
|
|
||||||
'account_activity_alerts',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'user_id' => 'integer',
|
'user_id' => 'integer',
|
||||||
|
|||||||
@@ -9,17 +9,7 @@ class PrintRequest extends BaseModel
|
|||||||
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['teacher_id', 'admin_id', 'class_id', 'file_path', 'page_selection', 'num_copies', 'required_by', 'pickup_method', 'status', 'created_at', 'updated_at'];
|
||||||
'teacher_id',
|
|
||||||
'admin_id',
|
|
||||||
'class_id',
|
|
||||||
'file_path',
|
|
||||||
'page_selection',
|
|
||||||
'num_copies',
|
|
||||||
'required_by',
|
|
||||||
'pickup_method',
|
|
||||||
'status',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'teacher_id' => 'integer',
|
'teacher_id' => 'integer',
|
||||||
|
|||||||
+1
-18
@@ -15,24 +15,7 @@ class Project extends BaseModel
|
|||||||
/**
|
/**
|
||||||
* Mass assignment.
|
* Mass assignment.
|
||||||
*/
|
*/
|
||||||
protected $fillable = [
|
protected $fillable = ['student_id', 'school_id', 'class_section_id', 'updated_by', 'project_index', 'score', 'comment', 'semester', 'school_year', 'created_at', 'updated_at'];
|
||||||
'student_id',
|
|
||||||
'school_id',
|
|
||||||
'class_section_id',
|
|
||||||
'updated_by',
|
|
||||||
'project_index',
|
|
||||||
'score',
|
|
||||||
'max_points',
|
|
||||||
'status',
|
|
||||||
'excused_reason',
|
|
||||||
'locked_at',
|
|
||||||
'locked_by',
|
|
||||||
'comment',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If your table has created_at/updated_at columns (it does),
|
* If your table has created_at/updated_at columns (it does),
|
||||||
|
|||||||
@@ -9,18 +9,7 @@ class PromotionQueue extends BaseModel
|
|||||||
{
|
{
|
||||||
protected $table = 'promotion_queue';
|
protected $table = 'promotion_queue';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['student_id', 'from_class_section_id', 'to_class_id', 'to_class_section_id', 'school_year_from', 'school_year_to', 'status', 'created_at', 'updated_at', 'updated_by'];
|
||||||
'student_id',
|
|
||||||
'from_class_section_id',
|
|
||||||
'to_class_id',
|
|
||||||
'to_class_section_id',
|
|
||||||
'school_year_from',
|
|
||||||
'school_year_to',
|
|
||||||
'status',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
'updated_by',
|
|
||||||
];
|
|
||||||
|
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
|
|||||||
@@ -13,17 +13,7 @@ class PurchaseOrder extends BaseModel
|
|||||||
|
|
||||||
protected $table = 'purchase_orders';
|
protected $table = 'purchase_orders';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['po_number', 'supplier_id', 'status', 'order_date', 'expected_date', 'subtotal', 'tax', 'total', 'notes'];
|
||||||
'po_number',
|
|
||||||
'supplier_id',
|
|
||||||
'status',
|
|
||||||
'order_date',
|
|
||||||
'expected_date',
|
|
||||||
'subtotal',
|
|
||||||
'tax',
|
|
||||||
'total',
|
|
||||||
'notes',
|
|
||||||
];
|
|
||||||
|
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
|
|||||||
@@ -8,15 +8,7 @@ class PurchaseOrderItem extends BaseModel
|
|||||||
{
|
{
|
||||||
protected $table = 'purchase_order_items';
|
protected $table = 'purchase_order_items';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['purchase_order_id', 'supply_id', 'description', 'quantity', 'received_qty', 'unit_cost'];
|
||||||
'purchase_order_id',
|
|
||||||
'supply_id',
|
|
||||||
'inventory_item_id',
|
|
||||||
'description',
|
|
||||||
'quantity',
|
|
||||||
'received_qty',
|
|
||||||
'unit_cost',
|
|
||||||
];
|
|
||||||
|
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
|
|||||||
+2
-19
@@ -8,26 +8,9 @@ class Quiz extends BaseModel
|
|||||||
{
|
{
|
||||||
protected $table = 'quiz';
|
protected $table = 'quiz';
|
||||||
|
|
||||||
public $timestamps = false;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['student_id', 'school_id', 'class_section_id', 'updated_by', 'quiz_index', 'score', 'comment', 'semester', 'school_year', 'created_at', 'updated_at'];
|
||||||
'student_id',
|
|
||||||
'school_id',
|
|
||||||
'class_section_id',
|
|
||||||
'updated_by',
|
|
||||||
'quiz_index',
|
|
||||||
'score',
|
|
||||||
'max_points',
|
|
||||||
'status',
|
|
||||||
'excused_reason',
|
|
||||||
'locked_at',
|
|
||||||
'locked_by',
|
|
||||||
'comment',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'student_id' => 'integer',
|
'student_id' => 'integer',
|
||||||
|
|||||||
+1
-21
@@ -9,27 +9,7 @@ class Refund extends BaseModel
|
|||||||
{
|
{
|
||||||
protected $table = 'refunds';
|
protected $table = 'refunds';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['parent_id', 'school_year', 'invoice_id', 'refund_amount', 'requested_at', 'approved_at', 'refunded_at', 'status', 'reason', 'refund_paid_amount', 'request', 'note', 'approved_by', 'updated_by', 'refund_method', 'check_nbr', 'check_file', 'created_at', 'updated_at', 'semester'];
|
||||||
'parent_id',
|
|
||||||
'school_year',
|
|
||||||
'invoice_id',
|
|
||||||
'refund_amount',
|
|
||||||
'requested_at',
|
|
||||||
'approved_at',
|
|
||||||
'refunded_at',
|
|
||||||
'status',
|
|
||||||
'reason',
|
|
||||||
'refund_paid_amount',
|
|
||||||
'request',
|
|
||||||
'note',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'approved_by',
|
|
||||||
'updated_by',
|
|
||||||
'refund_method',
|
|
||||||
'check_nbr',
|
|
||||||
'check_file',
|
|
||||||
];
|
|
||||||
|
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
|
|||||||
@@ -9,21 +9,7 @@ class Reimbursement extends BaseModel
|
|||||||
{
|
{
|
||||||
protected $table = 'reimbursements';
|
protected $table = 'reimbursements';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['expense_id', 'amount', 'reimbursed_to', 'approved_by', 'receipt_path', 'description', 'status', 'added_by', 'created_at', 'updated_at', 'school_year', 'semester', 'check_number', 'reimbursement_method', 'batch_number'];
|
||||||
'amount',
|
|
||||||
'reimbursed_to',
|
|
||||||
'approved_by',
|
|
||||||
'receipt_path',
|
|
||||||
'description',
|
|
||||||
'status',
|
|
||||||
'expense_id',
|
|
||||||
'added_by',
|
|
||||||
'school_year',
|
|
||||||
'semester',
|
|
||||||
'check_number',
|
|
||||||
'reimbursement_method',
|
|
||||||
'batch_number',
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If your table has created_at/updated_at, keep timestamps (default).
|
* If your table has created_at/updated_at, keep timestamps (default).
|
||||||
|
|||||||
@@ -15,18 +15,7 @@ class ReimbursementBatch extends BaseModel
|
|||||||
*/
|
*/
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['title', 'yearly_batch_number', 'status', 'school_year', 'semester', 'created_by', 'closed_by', 'opened_at', 'closed_at', 'notes'];
|
||||||
'title',
|
|
||||||
'status',
|
|
||||||
'created_by',
|
|
||||||
'closed_by',
|
|
||||||
'opened_at',
|
|
||||||
'closed_at',
|
|
||||||
'notes',
|
|
||||||
'school_year',
|
|
||||||
'semester',
|
|
||||||
'yearly_batch_number',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'created_by' => 'integer',
|
'created_by' => 'integer',
|
||||||
|
|||||||
@@ -13,14 +13,7 @@ class ReimbursementBatchAdminFile extends BaseModel
|
|||||||
*/
|
*/
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['batch_id', 'admin_id', 'filename', 'original_filename', 'uploaded_at', 'uploaded_by'];
|
||||||
'batch_id',
|
|
||||||
'admin_id',
|
|
||||||
'filename',
|
|
||||||
'original_filename',
|
|
||||||
'uploaded_at',
|
|
||||||
'uploaded_by',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'batch_id' => 'integer',
|
'batch_id' => 'integer',
|
||||||
|
|||||||
@@ -14,17 +14,7 @@ class ReimbursementBatchItem extends BaseModel
|
|||||||
*/
|
*/
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['batch_id', 'expense_id', 'reimbursement_id', 'admin_id', 'assigned_at', 'unassigned_at', 'notes', 'school_year', 'semester'];
|
||||||
'batch_id',
|
|
||||||
'expense_id',
|
|
||||||
'reimbursement_id',
|
|
||||||
'admin_id',
|
|
||||||
'assigned_at',
|
|
||||||
'unassigned_at',
|
|
||||||
'notes',
|
|
||||||
'school_year',
|
|
||||||
'semester',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'batch_id' => 'integer',
|
'batch_id' => 'integer',
|
||||||
|
|||||||
+1
-10
@@ -8,16 +8,7 @@ class Role extends BaseModel
|
|||||||
{
|
{
|
||||||
protected $table = 'roles';
|
protected $table = 'roles';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['name', 'slug', 'description', 'dashboard_route', 'priority', 'is_active', 'created_at', 'updated_at'];
|
||||||
'name',
|
|
||||||
'slug',
|
|
||||||
'description',
|
|
||||||
'dashboard_route',
|
|
||||||
'priority',
|
|
||||||
'is_active',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
|
|||||||
@@ -11,10 +11,7 @@ class RoleNavItem extends BaseModel
|
|||||||
|
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['role_id', 'nav_item_id', 'created_at', 'updated_at'];
|
||||||
'role_id',
|
|
||||||
'nav_item_id',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'role_id' => 'integer',
|
'role_id' => 'integer',
|
||||||
|
|||||||
@@ -10,17 +10,7 @@ class RolePermission extends BaseModel
|
|||||||
{
|
{
|
||||||
protected $table = 'role_permissions';
|
protected $table = 'role_permissions';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['role_id', 'permission_id', 'can_create', 'can_read', 'can_update', 'can_delete', 'can_manage', 'created_at', 'updated_at'];
|
||||||
'role_id',
|
|
||||||
'permission_id',
|
|
||||||
'can_create',
|
|
||||||
'can_read',
|
|
||||||
'can_update',
|
|
||||||
'can_delete',
|
|
||||||
'can_manage',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
|
|||||||
@@ -13,24 +13,13 @@ class ScoreComment extends BaseModel
|
|||||||
* legacy: timestamps disabled (created_at handled by DB default).
|
* legacy: timestamps disabled (created_at handled by DB default).
|
||||||
* Keep disabled in Laravel too.
|
* Keep disabled in Laravel too.
|
||||||
*/
|
*/
|
||||||
public $timestamps = true;
|
public $timestamps = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If your DB uses created_at as default timestamp and you want Laravel
|
* If your DB uses created_at as default timestamp and you want Laravel
|
||||||
* to treat it as a date, keep it in casts below.
|
* to treat it as a date, keep it in casts below.
|
||||||
*/
|
*/
|
||||||
protected $fillable = [
|
protected $fillable = ['student_id', 'class_section_id', 'score_type', 'semester', 'school_year', 'comment', 'comment_review', 'reviewed_by', 'commented_by', 'created_at'];
|
||||||
'student_id',
|
|
||||||
'class_section_id',
|
|
||||||
'score_type',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'comment',
|
|
||||||
'comment_review',
|
|
||||||
'reviewed_by',
|
|
||||||
'commented_by',
|
|
||||||
'created_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'student_id' => 'integer',
|
'student_id' => 'integer',
|
||||||
|
|||||||
@@ -9,15 +9,9 @@ class Section extends BaseModel
|
|||||||
{
|
{
|
||||||
protected $table = 'sections';
|
protected $table = 'sections';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['section_name', 'description', 'updated_at', 'updated_by'];
|
||||||
'section_name',
|
|
||||||
'description',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
'updated_by',
|
|
||||||
];
|
|
||||||
|
|
||||||
public $timestamps = true;
|
public $timestamps = false;
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'updated_by' => 'integer',
|
'updated_by' => 'integer',
|
||||||
|
|||||||
@@ -9,27 +9,7 @@ class SemesterScore extends BaseModel
|
|||||||
{
|
{
|
||||||
protected $table = 'semester_scores';
|
protected $table = 'semester_scores';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['student_id', 'school_id', 'class_section_id', 'updated_by', 'homework_avg', 'quiz_avg', 'project_avg', 'midterm_exam_score', 'final_exam_score', 'attendance_score', 'participation_score', 'ptap_score', 'test_avg', 'semester_score', 'semester', 'school_year', 'created_at', 'updated_at'];
|
||||||
'student_id',
|
|
||||||
'school_id',
|
|
||||||
'class_section_id',
|
|
||||||
'updated_by',
|
|
||||||
'homework_avg',
|
|
||||||
'quiz_avg',
|
|
||||||
'project_avg',
|
|
||||||
'midterm_exam_score',
|
|
||||||
'final_exam_score',
|
|
||||||
'attendance_score',
|
|
||||||
'participation_score',
|
|
||||||
'ptap_score',
|
|
||||||
'test_avg',
|
|
||||||
'semester_score',
|
|
||||||
'calculation_mode',
|
|
||||||
'calculation_policy_version',
|
|
||||||
'snapshot_id',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If your table has created_at/updated_at columns, keep this true (default).
|
* If your table has created_at/updated_at columns, keep this true (default).
|
||||||
|
|||||||
@@ -9,13 +9,7 @@ class Setting extends BaseModel
|
|||||||
{
|
{
|
||||||
protected $table = 'settings';
|
protected $table = 'settings';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['name', 'timezone', 'updated_by', 'created_at', 'updated_at'];
|
||||||
'name',
|
|
||||||
'timezone',
|
|
||||||
'updated_by',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
|
|||||||
+2
-14
@@ -12,21 +12,9 @@ class Staff extends BaseModel
|
|||||||
/**
|
/**
|
||||||
* legacy: timestamps managed manually (created_at/updated_at set by caller/controller)
|
* legacy: timestamps managed manually (created_at/updated_at set by caller/controller)
|
||||||
*/
|
*/
|
||||||
public $timestamps = false;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['firstname', 'lastname', 'email', 'phone', 'role_name', 'school_year', 'active_role', 'created_at', 'updated_at', 'user_id'];
|
||||||
'user_id',
|
|
||||||
'firstname',
|
|
||||||
'lastname',
|
|
||||||
'email',
|
|
||||||
'phone',
|
|
||||||
'role_name',
|
|
||||||
'active_role',
|
|
||||||
'status',
|
|
||||||
'school_year',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'user_id' => 'integer',
|
'user_id' => 'integer',
|
||||||
|
|||||||
@@ -20,22 +20,7 @@ class StaffAttendance extends BaseModel
|
|||||||
* ✅ If class_section_id/position DO exist in your DB, add them to fillable.
|
* ✅ If class_section_id/position DO exist in your DB, add them to fillable.
|
||||||
* ❌ If they do NOT exist, remove them and also remove related methods/scopes.
|
* ❌ If they do NOT exist, remove them and also remove related methods/scopes.
|
||||||
*/
|
*/
|
||||||
protected $fillable = [
|
protected $fillable = ['user_id', 'role_name', 'date', 'semester', 'school_year', 'status', 'reason', 'created_at', 'updated_at', 'created_by', 'updated_by'];
|
||||||
'user_id',
|
|
||||||
'role_name',
|
|
||||||
'date',
|
|
||||||
'semester',
|
|
||||||
'school_year',
|
|
||||||
'status',
|
|
||||||
'present',
|
|
||||||
'absent',
|
|
||||||
'late',
|
|
||||||
'reason',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
'created_by',
|
|
||||||
'updated_by',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'user_id' => 'integer',
|
'user_id' => 'integer',
|
||||||
|
|||||||
@@ -12,12 +12,7 @@ class Stats extends BaseModel
|
|||||||
*/
|
*/
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['students', 'teachers', 'admins', 'users'];
|
||||||
'students',
|
|
||||||
'teachers',
|
|
||||||
'admins',
|
|
||||||
'users',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'students' => 'integer',
|
'students' => 'integer',
|
||||||
|
|||||||
+1
-19
@@ -19,25 +19,7 @@ class Student extends BaseModel
|
|||||||
*/
|
*/
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['school_id', 'firstname', 'lastname', 'dob', 'age', 'gender', 'is_active', 'registration_grade', 'is_new', 'photo_consent', 'parent_id', 'registration_date', 'tuition_paid', 'rfid_tag', 'semester', 'year_of_registration', 'school_year'];
|
||||||
'school_id',
|
|
||||||
'firstname',
|
|
||||||
'lastname',
|
|
||||||
'dob',
|
|
||||||
'age',
|
|
||||||
'gender',
|
|
||||||
'registration_grade',
|
|
||||||
'photo_consent',
|
|
||||||
'is_new',
|
|
||||||
'parent_id',
|
|
||||||
'school_year',
|
|
||||||
'semester',
|
|
||||||
'registration_date',
|
|
||||||
'tuition_paid',
|
|
||||||
'year_of_registration',
|
|
||||||
'rfid_tag',
|
|
||||||
'is_active',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'school_id' => 'string',
|
'school_id' => 'string',
|
||||||
|
|||||||
@@ -14,10 +14,7 @@ class StudentAllergy extends BaseModel
|
|||||||
*/
|
*/
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = ['student_id', 'allergy'];
|
||||||
'student_id',
|
|
||||||
'allergy',
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'student_id' => 'integer',
|
'student_id' => 'integer',
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user