-
-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/origin/php8' into php8
- Loading branch information
Showing
22 changed files
with
459 additions
and
10 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
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,76 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources\Oauth; | ||
|
||
use App\Filament\Resources\Oauth\AccessTokenResource\Pages; | ||
use App\Filament\Resources\Oauth\AccessTokenResource\RelationManagers; | ||
use Laravel\Passport\Token; | ||
use Filament\Forms; | ||
use Filament\Resources\Form; | ||
use Filament\Resources\Resource; | ||
use Filament\Resources\Table; | ||
use Filament\Tables; | ||
use Illuminate\Database\Eloquent\Builder; | ||
use Illuminate\Database\Eloquent\SoftDeletingScope; | ||
|
||
class AccessTokenResource extends Resource | ||
{ | ||
protected static ?string $model = Token::class; | ||
|
||
protected static ?string $navigationIcon = 'heroicon-o-collection'; | ||
|
||
protected static ?string $navigationGroup = 'Oauth'; | ||
|
||
protected static ?int $navigationSort = 3; | ||
|
||
protected static function getNavigationLabel(): string | ||
{ | ||
return __('admin.sidebar.oauth_access_token'); | ||
} | ||
|
||
public static function getBreadcrumb(): string | ||
{ | ||
return self::getNavigationLabel(); | ||
} | ||
|
||
public static function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
// | ||
]); | ||
} | ||
|
||
public static function table(Table $table): Table | ||
{ | ||
return $table | ||
->columns([ | ||
Tables\Columns\TextColumn::make('id')->searchable(), | ||
Tables\Columns\TextColumn::make('user.username') | ||
->label(__('label.username')) | ||
->formatStateUsing(fn ($record) => username_for_admin($record->user_id)), | ||
Tables\Columns\TextColumn::make('client.name') | ||
->label(__('oauth.client')), | ||
Tables\Columns\TextColumn::make('expires_at') | ||
->label(__('label.expire_at')) | ||
|
||
]) | ||
->filters([ | ||
// | ||
]) | ||
->actions([ | ||
// Tables\Actions\EditAction::make(), | ||
Tables\Actions\DeleteAction::make(), | ||
]) | ||
->bulkActions([ | ||
Tables\Actions\DeleteBulkAction::make(), | ||
]); | ||
} | ||
|
||
public static function getPages(): array | ||
{ | ||
return [ | ||
'index' => Pages\ManageAccessTokens::route('/'), | ||
]; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
app/Filament/Resources/Oauth/AccessTokenResource/Pages/ManageAccessTokens.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,20 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources\Oauth\AccessTokenResource\Pages; | ||
|
||
use App\Filament\PageListSingle; | ||
use App\Filament\Resources\Oauth\AccessTokenResource; | ||
use Filament\Pages\Actions; | ||
use Filament\Resources\Pages\ManageRecords; | ||
|
||
class ManageAccessTokens extends PageListSingle | ||
{ | ||
protected static string $resource = AccessTokenResource::class; | ||
|
||
protected function getActions(): array | ||
{ | ||
return [ | ||
// Actions\CreateAction::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,75 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources\Oauth; | ||
|
||
use App\Filament\Resources\Oauth\AuthCodeResource\Pages; | ||
use App\Filament\Resources\Oauth\AuthCodeResource\RelationManagers; | ||
use Laravel\Passport\AuthCode; | ||
use Filament\Forms; | ||
use Filament\Resources\Form; | ||
use Filament\Resources\Resource; | ||
use Filament\Resources\Table; | ||
use Filament\Tables; | ||
use Illuminate\Database\Eloquent\Builder; | ||
use Illuminate\Database\Eloquent\SoftDeletingScope; | ||
|
||
class AuthCodeResource extends Resource | ||
{ | ||
protected static ?string $model = AuthCode::class; | ||
|
||
protected static ?string $navigationIcon = 'heroicon-o-collection'; | ||
|
||
protected static ?string $navigationGroup = 'Oauth'; | ||
|
||
protected static ?int $navigationSort = 2; | ||
|
||
protected static function getNavigationLabel(): string | ||
{ | ||
return __('admin.sidebar.oauth_auth_code'); | ||
} | ||
|
||
public static function getBreadcrumb(): string | ||
{ | ||
return self::getNavigationLabel(); | ||
} | ||
|
||
public static function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
// | ||
]); | ||
} | ||
|
||
public static function table(Table $table): Table | ||
{ | ||
return $table | ||
->columns([ | ||
Tables\Columns\TextColumn::make('id'), | ||
Tables\Columns\TextColumn::make('user.username') | ||
->label(__('label.username')) | ||
->formatStateUsing(fn ($record) => username_for_admin($record->user_id)), | ||
Tables\Columns\TextColumn::make('client.name') | ||
->label(__('oauth.client')), | ||
Tables\Columns\TextColumn::make('expires_at') | ||
->label(__('label.expire_at')) | ||
]) | ||
->filters([ | ||
// | ||
]) | ||
->actions([ | ||
// Tables\Actions\EditAction::make(), | ||
Tables\Actions\DeleteAction::make(), | ||
]) | ||
->bulkActions([ | ||
Tables\Actions\DeleteBulkAction::make(), | ||
]); | ||
} | ||
|
||
public static function getPages(): array | ||
{ | ||
return [ | ||
'index' => Pages\ManageAuthCodes::route('/'), | ||
]; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
app/Filament/Resources/Oauth/AuthCodeResource/Pages/ManageAuthCodes.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,20 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources\Oauth\AuthCodeResource\Pages; | ||
|
||
use App\Filament\PageListSingle; | ||
use App\Filament\Resources\Oauth\AuthCodeResource; | ||
use Filament\Pages\Actions; | ||
use Filament\Resources\Pages\ManageRecords; | ||
|
||
class ManageAuthCodes extends PageListSingle | ||
{ | ||
protected static string $resource = AuthCodeResource::class; | ||
|
||
protected function getActions(): array | ||
{ | ||
return [ | ||
// Actions\CreateAction::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,75 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources\Oauth; | ||
|
||
use App\Filament\PageListSingle; | ||
use App\Filament\Resources\Oauth\ClientResource\Pages; | ||
use App\Filament\Resources\Oauth\ClientResource\RelationManagers; | ||
use Laravel\Passport\Client; | ||
use Filament\Forms; | ||
use Filament\Resources\Form; | ||
use Filament\Resources\Resource; | ||
use Filament\Resources\Table; | ||
use Filament\Tables; | ||
use Illuminate\Database\Eloquent\Builder; | ||
use Illuminate\Database\Eloquent\SoftDeletingScope; | ||
|
||
class ClientResource extends Resource | ||
{ | ||
protected static ?string $model = Client::class; | ||
|
||
protected static ?string $navigationIcon = 'heroicon-o-collection'; | ||
|
||
protected static ?string $navigationGroup = 'Oauth'; | ||
|
||
protected static ?int $navigationSort = 1; | ||
|
||
protected static function getNavigationLabel(): string | ||
{ | ||
return __('admin.sidebar.oauth_client'); | ||
} | ||
|
||
public static function getBreadcrumb(): string | ||
{ | ||
return self::getNavigationLabel(); | ||
} | ||
|
||
public static function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
Forms\Components\TextInput::make('name')->label(__('label.name')), | ||
Forms\Components\TextInput::make('redirect')->label(__('oauth.redirect')), | ||
|
||
]); | ||
} | ||
|
||
public static function table(Table $table): Table | ||
{ | ||
return $table | ||
->columns([ | ||
Tables\Columns\TextColumn::make('id'), | ||
Tables\Columns\TextColumn::make('name')->label(__('label.name')), | ||
Tables\Columns\TextColumn::make('secret')->label(__('oauth.secret')), | ||
Tables\Columns\TextColumn::make('redirect')->label(__('oauth.redirect')), | ||
|
||
]) | ||
->filters([ | ||
// | ||
]) | ||
->actions([ | ||
Tables\Actions\EditAction::make(), | ||
Tables\Actions\DeleteAction::make(), | ||
]) | ||
->bulkActions([ | ||
Tables\Actions\DeleteBulkAction::make(), | ||
]); | ||
} | ||
|
||
public static function getPages(): array | ||
{ | ||
return [ | ||
'index' => Pages\ManageClients::route('/'), | ||
]; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
app/Filament/Resources/Oauth/ClientResource/Pages/ManageClients.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,20 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources\Oauth\ClientResource\Pages; | ||
|
||
use App\Filament\PageListSingle; | ||
use App\Filament\Resources\Oauth\ClientResource; | ||
use Filament\Pages\Actions; | ||
use Filament\Resources\Pages\ManageRecords; | ||
|
||
class ManageClients extends PageListSingle | ||
{ | ||
protected static string $resource = ClientResource::class; | ||
|
||
protected function getActions(): array | ||
{ | ||
return [ | ||
Actions\CreateAction::make(), | ||
]; | ||
} | ||
} |
Oops, something went wrong.