filament-nested-resources
filament-nested-resources copied to clipboard
[Bug]: Access to undeclared static property App\Filament\Resources\CourseResource\Pages\CreateCourseLesson::$relationship
What happened?
When I am trying to navigate to the create page I am getting the below error.
Access to undeclared static property App\Filament\Resources\CourseResource\Pages\CreateCourseLesson::$relationship
This is the content of my CourseResource\Pages\CreateCourseLesson.php file.
<?php
namespace App\Filament\Resources\CourseResource\Pages;
use App\Filament\Resources\CourseResource;
use Guava\FilamentNestedResources\Concerns\NestedPage;
use Guava\FilamentNestedResources\Pages\CreateRelatedRecord;
class CreateCourseLesson extends CreateRelatedRecord
{
use NestedPage;
protected static string $resource = CourseResource::class;
}
Did I miss something here?
How to reproduce the bug
When creating lesson from the relation page.
Package Version
1.0
PHP Version
8.3
Laravel Version
11
Which operating systems does with happen with?
macOS
Notes
No response
Also could you please provide the source code of the example given for Artist/Albums/Songs too?
@z4yed You need to implement the $relationship property. I guess in your case it will be something like:
protected static string $relationship = 'lessons';
This worked. However, when I am in view/edit page of any lesson, the root navigation section Courses is not active (highlighted). Please see attached image.
This worked. However, when I am in view/edit page of any lesson, the
rootnavigation sectionCoursesis not active (highlighted). Please see attached image.
Great catch, thanks. Will fix it in the next release. :)
dear all i use to create but it don't fixin with my require
here is what i want i have series, seasons,episodes
but record is only one get how do i make
Model
Series have many Season Season have belongto series and have many episodes episodes have belongto series
So route should be like that series/{record}/seasons/{record}/episodes
