call to undefined method App\Models\Student::class()

Hi devs I have a problem in my student management project, the general display of students works but when I click on edit I have this error that appears
call to undefined method App\Models\Student::class()
call to undefined method App\Models\Student::class()
My EditStudent file
<?php

namespace App\Filament\Resources\StudentResource\Pages;

use App\Filament\Resources\StudentResource;
use Filament\Pages\Actions;
use Filament\Resources\Pages\EditRecord;

class EditStudent extends EditRecord
{
protected static string $resource = StudentResource::class;

protected function getActions(): array
{
return [
//
];
}
}
<?php

namespace App\Filament\Resources\StudentResource\Pages;

use App\Filament\Resources\StudentResource;
use Filament\Pages\Actions;
use Filament\Resources\Pages\EditRecord;

class EditStudent extends EditRecord
{
protected static string $resource = StudentResource::class;

protected function getActions(): array
{
return [
//
];
}
}
3 Replies
Sal Aime
Sal AimeOP17mo ago
My Student Model
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Student extends Model
{
use HasFactory;

protected $fillable = [
'class_id',
'section_id',
'name',
'first_name',
'class',
'birth',
'phone_number',
];

public function section()
{
return $this->belongsTo(Section::class, 'section_id');
}
}
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Student extends Model
{
use HasFactory;

protected $fillable = [
'class_id',
'section_id',
'name',
'first_name',
'class',
'birth',
'phone_number',
];

public function section()
{
return $this->belongsTo(Section::class, 'section_id');
}
}
I send my StudentResource 🤧
Sal Aime
Sal AimeOP17mo ago
Filament
Filament17mo ago
We need more information to help you debug your problem. Please click on the top left 'SHARE' button of the error page you're seeing and share the link with us.
Want results from more Discord servers?
Add your server