Closed aeq-dev closed 4 months ago
Just render the widget in your custom page
https://filamentphp.com/docs/3.x/widgets/adding-a-widget-to-a-blade-view
Thanksss :)))
@lukas-frey how can I access the model record in the calendar widget. Ex.
<?php
namespace App\Filament\Resources\InstructorResource\Pages;
use App\Filament\Resources\InstructorResource; use Filament\Actions; use Filament\Resources\Pages\ViewRecord;
class InstructorCalendar extends ViewRecord { protected static string $resource = InstructorResource::class;
protected static string $view = 'filament.pages.instructor-calendar';
}
- `filament.pages.instructor-calendar` blade view for the page
```php
<div>
@livewire(\App\Livewire\InstructorSchedule::class)
</div>
<?php
namespace App\Livewire;
use Filament\Tables\Actions\Concerns\InteractsWithRecords; use Guava\Calendar\Widgets\CalendarWidget; use Illuminate\Support\Collection;
class InstructorSchedule extends CalendarWidget { use InteractsWithRecords;
public function getEvents(array $fetchInfo = []): Collection|array
{
return [];
}
}
My page is accessible at url `https://app.com/instructors/3/calendar` and I want to access the instructors record using the route id in the url so I can fetch the instructors schedule.
Add public ?Model $record = null;
to the widget
@lukas-frey Unfortunately I have already tried this and I get null when I dump the $record
in the getEvents
method.
What feature would you like to add?
Hello, Can we use a custom page instead of widget ? I want to set a side area for resources items for example, something like this Fullcalendar Thanks :)
Notes
No response