Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
AlpetGexha committed Jun 27, 2023
1 parent b3d4e0e commit 3b64c7a
Show file tree
Hide file tree
Showing 9 changed files with 26,433 additions and 61 deletions.
25,721 changes: 25,721 additions & 0 deletions _ide_helper.php

Large diffs are not rendered by default.

33 changes: 10 additions & 23 deletions app/Filament/Resources/UserResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@
namespace App\Filament\Resources;

use App\Filament\Resources\UserResource\Pages;
use App\Filament\Resources\UserResource\RelationManagers;
use App\Filament\Resources\UserResource\Widgets\UserOverview;
use App\Models\User;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\Resource;
use Filament\Resources\Table;
use Filament\Tables;
use Filament\Tables\Columns\Column;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use STS\FilamentImpersonate\Tables\Actions\Impersonate;

class UserResource extends Resource
{
Expand All @@ -23,23 +20,6 @@ class UserResource extends Resource

protected static ?string $navigationIcon = 'heroicon-o-user-group';

public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('name')
->required()
->maxLength(255),
Forms\Components\TextInput::make('email')
->email()
->required()
->unique()
->maxLength(255),
Forms\Components\Select::make('current_company_id')
->relationship('currentCompany', 'name'),
Forms\Components\TextInput::make('current_connected_account_id'),
]);
}

public static function table(Table $table): Table
{
Expand All @@ -57,8 +37,8 @@ public static function table(Table $table): Table
->searchable(),
Tables\Columns\TextColumn::make('email_verified_at')
->dateTime(),
Tables\Columns\TextColumn::make('currentCompany.name'),
Tables\Columns\TextColumn::make('current_connected_account_id'),
// Tables\Columns\TextColumn::make('currentCompany.name'),
// Tables\Columns\TextColumn::make('current_connected_account_id'),
Tables\Columns\TextColumn::make('created_at')
->dateTime(),
])
Expand Down Expand Up @@ -90,4 +70,11 @@ public static function getPages(): array
'edit' => Pages\EditUser::route('/{record}/edit'),
];
}

protected function getHeaderWidgets(): array
{
return [
UserOverview::class,
];
}
}
34 changes: 34 additions & 0 deletions app/Filament/Resources/UserResource/Widgets/UserOverview.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace App\Filament\Resources\UserResource\Widgets;

use Filament\Widgets\StatsOverviewWidget as BaseWidget;
use Filament\Widgets\StatsOverviewWidget\Card;

class UserOverview extends BaseWidget
{
public bool $readyToLoad = false;

public function loadData(): void
{
$this->readyToLoad = true;
}

protected function getCards(): array
{
if (! $this->readyToLoad) {
$this->skeletonLoad();
}

return [
//
];
}

protected function skeletonLoad(): array
{
return [
Card::make('Loading Data', 'loading...'),
];
}
}
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.8",
"barryvdh/laravel-ide-helper": "^2.13",
"beyondcode/laravel-query-detector": "^1.7",
"doctrine/dbal": "^3.6",
"fakerphp/faker": "^1.9.1",
"glhd/laravel-dumper": "^1.1",
"laravel/pint": "^1.0",
"laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4",
Expand Down
Loading

0 comments on commit 3b64c7a

Please sign in to comment.