-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
working on events looking good so far
- Loading branch information
Showing
19 changed files
with
867 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
app/Filament/Resources/EventResource/Pages/CalendarPage.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources\EventResource\Pages; | ||
|
||
use App\Filament\Resources\EventResource; | ||
use App\Filament\Widgets\CalendarWidget; | ||
use Filament\Resources\Pages\Page; | ||
|
||
class CalendarPage extends Page | ||
{ | ||
protected static string $resource = EventResource::class; | ||
|
||
protected static string $view = 'filament.resources.event-resource.pages.calendar-page'; | ||
|
||
protected function getHeaderWidgets(): array | ||
{ | ||
return [ | ||
CalendarWidget::class, | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources\EventResource\Pages; | ||
|
||
use App\Filament\Resources\EventResource; | ||
use Filament\Actions; | ||
use Filament\Resources\Pages\ViewRecord; | ||
|
||
class ViewEvent extends ViewRecord | ||
{ | ||
protected static string $resource = EventResource::class; | ||
|
||
protected function getHeaderActions(): array | ||
{ | ||
return [ | ||
Actions\EditAction::make(), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace App\Filament\Widgets; | ||
|
||
use App\Filament\Resources\EventResource; | ||
use App\Models\Event; | ||
use Saade\FilamentFullCalendar\Widgets\FullCalendarWidget; | ||
|
||
class CalendarWidget extends FullCalendarWidget | ||
{ | ||
protected static ?int $sort = 2; | ||
|
||
public function fetchEvents(array $info): array | ||
{ | ||
|
||
return Event::query() | ||
->where('start_date', '>=', $info['start']) | ||
->where('end_date', '<=', $info['end']) | ||
->get() | ||
->map( | ||
fn (Event $event) => [ | ||
'title' => $event->title, | ||
'start' => $event->start, | ||
'end' => $event->end, | ||
'url' => EventResource::getUrl(name: 'view', parameters: ['record' => $event]), | ||
'shouldOpenUrlInNewTab' => true, | ||
] | ||
) | ||
->all(); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.