Nobody
Is It Possible to Use a Single Login URL for All Roles in Filament Shield?
I am currently using Filament Shield with 3 roles: Admin, User, and Courier, and 2 panels: Admin and Courier. The login URLs are currently separated, such as https://url/admin/login for Admin and https://url/courier/login for Courier. I want to change it so that there is only one login URL, like https://url/login. After login, the system will check the user’s role and redirect them to the appropriate panel:
If the role is Admin, redirect to the Admin Panel.
If the role is Courier, redirect to the Courier Panel.
If the role is User, the login should be rejected.
Is this possible to achieve with Filament Shield?
28 replies
Infolist has no [record()] or [state()] set.
I tried to display maps or google maps using filament-google-maps from cheesegrits.
but ran into a problem that Infolist has no [record()] or [state()] set.
Here is the code
<?php
namespace App\Filament\Pages;
use App\Models\Location;
use Cheesegrits\FilamentGoogleMaps\Fields\Map;
use Cheesegrits\FilamentGoogleMaps\Infolists\MapEntry;
use Filament\Infolists\Infolist;
use Filament\Pages\Page;
class TaskDashboard extends Page
{
protected static ?string $navigationIcon = 'heroicon-o-document-text';
protected static string $view = 'filament.pages.task-dashboard';
public ?array $data = [];
public function getTitle(): string
{
return '';
}
public function infolist(Infolist $infolist): Infolist
{
return $infolist
->schema([
MapEntry::make('map')
->columnSpanFull()
->height('500px')
->defaultZoom(10)
->defaultLocation([39.526610, -107.727261]) // default for new forms
]);
}
}
this is task-dashboard.blade.php
{{-- @vite('resources/css/filament/app/theme.css') --}}
@vite('resources/css/app.css')
<x-filament-panels::page>
<div class="w-full h-[500px]">
{{ $this->infolist }}
</div>
</x-filament-panels::page>
3 replies