-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
948225e
commit 6210d43
Showing
10 changed files
with
204 additions
and
79 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?php | ||
|
||
namespace App\Filament\Pages\Auth; | ||
|
||
use Filament\Pages\Page; | ||
use Filament\Actions\Action; | ||
use Filament\Forms\Components\Component; | ||
use Filament\Forms\Components\TextInput; | ||
use Filament\Pages\Auth\Login as BaseLogin; | ||
use DanHarrin\LivewireRateLimiting\WithRateLimiting; | ||
use Filament\Pages\Concerns\InteractsWithFormActions; | ||
|
||
class Login extends BaseLogin | ||
{ | ||
use InteractsWithFormActions; | ||
use WithRateLimiting; | ||
protected function getCredentialsFromFormData(array $data): array | ||
{ | ||
return [ | ||
'name' => $data['name'], | ||
'password' => $data['password'], | ||
]; | ||
} | ||
|
||
protected function getFormActions(): array | ||
{ | ||
return [ | ||
$this->getAuthenticateFormAction(), | ||
]; | ||
} | ||
|
||
protected function hasFullWidthFormActions(): bool | ||
{ | ||
return true; | ||
} | ||
|
||
protected function getNameFormComponent(): Component | ||
{ | ||
return TextInput::make('name') | ||
->label(__('Username')) | ||
->required() | ||
->autocomplete() | ||
->autofocus() | ||
->extraInputAttributes(['tabindex' => 1]); | ||
} | ||
|
||
protected function getForms(): array | ||
{ | ||
return [ | ||
'form' => $this->form( | ||
$this->makeForm() | ||
->schema([ | ||
$this->getNameFormComponent(), | ||
$this->getPasswordFormComponent(), | ||
$this->getRememberFormComponent(), | ||
]) | ||
->statePath('data'), | ||
), | ||
]; | ||
} | ||
|
||
|
||
protected function getAuthenticateFormAction(): Action | ||
{ | ||
return Action::make('authenticate') | ||
->label(__('filament-panels::pages/auth/login.form.actions.authenticate.label')) | ||
->submit('authenticate'); | ||
} | ||
} |
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,105 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources; | ||
|
||
use App\Filament\Resources\UserResource\Pages; | ||
use App\Filament\Resources\UserResource\RelationManagers; | ||
use App\Models\User; | ||
use Filament\Forms; | ||
use Filament\Forms\Form; | ||
use Filament\Resources\Resource; | ||
use Filament\Tables; | ||
use Filament\Tables\Table; | ||
use Illuminate\Database\Eloquent\Builder; | ||
use Illuminate\Database\Eloquent\SoftDeletingScope; | ||
|
||
class UserResource extends Resource | ||
{ | ||
protected static ?string $model = User::class; | ||
|
||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack'; | ||
|
||
public static function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
Forms\Components\TextInput::make('pegawai_id') | ||
->maxLength(65), | ||
Forms\Components\TextInput::make('name') | ||
->required() | ||
->maxLength(255), | ||
Forms\Components\TextInput::make('email') | ||
->email() | ||
->maxLength(255), | ||
Forms\Components\DateTimePicker::make('email_verified_at'), | ||
Forms\Components\TextInput::make('password') | ||
->password() | ||
->required() | ||
->maxLength(255), | ||
Forms\Components\TextInput::make('google_id') | ||
->maxLength(255), | ||
Forms\Components\TextInput::make('theme') | ||
->maxLength(255) | ||
->default('default'), | ||
Forms\Components\TextInput::make('theme_color') | ||
->maxLength(255), | ||
]); | ||
} | ||
|
||
public static function table(Table $table): Table | ||
{ | ||
return $table | ||
->columns([ | ||
Tables\Columns\TextColumn::make('pegawai_id') | ||
->searchable(), | ||
Tables\Columns\TextColumn::make('name') | ||
->searchable(), | ||
Tables\Columns\TextColumn::make('email') | ||
->searchable(), | ||
Tables\Columns\TextColumn::make('email_verified_at') | ||
->dateTime() | ||
->sortable(), | ||
Tables\Columns\TextColumn::make('created_at') | ||
->dateTime() | ||
->sortable() | ||
->toggleable(isToggledHiddenByDefault: true), | ||
Tables\Columns\TextColumn::make('updated_at') | ||
->dateTime() | ||
->sortable() | ||
->toggleable(isToggledHiddenByDefault: true), | ||
Tables\Columns\TextColumn::make('google_id') | ||
->searchable(), | ||
Tables\Columns\TextColumn::make('theme') | ||
->searchable(), | ||
Tables\Columns\TextColumn::make('theme_color') | ||
->searchable(), | ||
]) | ||
->filters([ | ||
// | ||
]) | ||
->actions([ | ||
Tables\Actions\EditAction::make(), | ||
]) | ||
->bulkActions([ | ||
Tables\Actions\BulkActionGroup::make([ | ||
Tables\Actions\DeleteBulkAction::make(), | ||
]), | ||
]); | ||
} | ||
|
||
public static function getRelations(): array | ||
{ | ||
return [ | ||
// | ||
]; | ||
} | ||
|
||
public static function getPages(): array | ||
{ | ||
return [ | ||
'index' => Pages\ListUsers::route('/'), | ||
'create' => Pages\CreateUser::route('/create'), | ||
'edit' => Pages\EditUser::route('/{record}/edit'), | ||
]; | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<x-filament-panels::page> | ||
|
||
</x-filament-panels::page> |
21 changes: 10 additions & 11 deletions
21
resources/views/vendor/filament-panels/components/logo.blade.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 |
---|---|---|
@@ -1,19 +1,18 @@ | ||
@php | ||
$brandName = filament()->getBrandName(); | ||
$brandLogo = filament()->getBrandLogo() | ||
$brandLogo = filament()->getBrandLogo(); | ||
@endphp | ||
|
||
@if (filled($brandLogo)) | ||
<img | ||
src="{{ $brandLogo }}" | ||
loading="lazy" | ||
alt="{{ $brandName }}" | ||
{{ $attributes->class(['fi-logo h-10']) }} | ||
/> | ||
<div class="flex items-center border py-2 px-2 rounded-xl"> | ||
<img src="{{ $brandLogo }}" loading="lazy" alt="{{ $brandName }}" | ||
{{ $attributes->class(['fi-logo h-10']) }} /> | ||
<div class="px-2"> | ||
<span class="font-bold">{{ $brandName }}</span> | ||
</div> | ||
</div> | ||
@else | ||
<div | ||
{{ $attributes->class(['fi-logo text-xl font-bold leading-5 tracking-tight text-gray-950 dark:text-white']) }} | ||
> | ||
<div {{ $attributes->class(['fi-logo text-xl font-bold leading-5 tracking-tight text-gray-950 dark:text-white']) }}> | ||
{{ $brandName }} | ||
</div> | ||
@endif | ||
@endif |