Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
azizovic12 authored and github-actions[bot] committed Mar 7, 2024
1 parent 998758b commit 9f625de
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 59 deletions.
38 changes: 19 additions & 19 deletions app/Providers/Filament/AdminPanelProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@

namespace App\Providers\Filament;

use Awcodes\FilamentGravatar\GravatarPlugin;
use Awcodes\FilamentGravatar\GravatarProvider;
use BezhanSalleh\FilamentShield\FilamentShieldPlugin;
use Filament\Http\Middleware\Authenticate;
use Filament\Http\Middleware\DisableBladeIconComponents;
use Filament\Http\Middleware\DispatchServingFilamentEvent;
use Filament\Pages;
use Filament\Panel;
use Filament\Widgets;
use Moox\Jobs\JobsPlugin;
use Moox\Page\PagePlugin;
use Moox\Sync\SyncPlugin;
use Moox\User\UserPlugin;
use Filament\PanelProvider;
use Moox\Builder\BuilderPlugin;
use Moox\Jobs\JobsFailedPlugin;
use Moox\Jobs\JobsBatchesPlugin;
use Moox\Jobs\JobsWaitingPlugin;
use Filament\Support\Colors\Color;
use Filament\Http\Middleware\Authenticate;
use Jeffgreco13\FilamentBreezy\BreezyCore;
use Awcodes\FilamentGravatar\GravatarPlugin;
use Awcodes\FilamentGravatar\GravatarProvider;
use Illuminate\Session\Middleware\StartSession;
use Filament\Widgets;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Cookie\Middleware\EncryptCookies;
use BezhanSalleh\FilamentShield\FilamentShieldPlugin;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Session\Middleware\AuthenticateSession;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\View\Middleware\ShareErrorsFromSession;
use Filament\Http\Middleware\DisableBladeIconComponents;
use Filament\Http\Middleware\DispatchServingFilamentEvent;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Jeffgreco13\FilamentBreezy\BreezyCore;
use Moox\Builder\BuilderPlugin;
use Moox\Jobs\JobsBatchesPlugin;
use Moox\Jobs\JobsFailedPlugin;
use Moox\Jobs\JobsPlugin;
use Moox\Jobs\JobsWaitingPlugin;
use Moox\Page\PagePlugin;
use Moox\Sync\SyncPlugin;
use Moox\User\UserPlugin;

class AdminPanelProvider extends PanelProvider
{
Expand Down
13 changes: 4 additions & 9 deletions packages/user/src/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@

use App\Models\User as BaseUser;
use Filament\Models\Contracts\HasAvatar;
use Filament\Models\Contracts\HasName;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\Storage;
use Jeffgreco13\FilamentBreezy\Traits\TwoFactorAuthenticatable;
use Spatie\Permission\Traits\HasRoles;
use Illuminate\Support\Facades\Storage;

class User extends BaseUser implements HasAvatar
{
use HasFactory, HasRoles, Notifiable, SoftDeletes, TwoFactorAuthenticatable;



protected $fillable = [
'name',
'slug',
Expand All @@ -30,8 +27,8 @@ class User extends BaseUser implements HasAvatar
'description',
'password',
'profile_photo_path',
];

];

protected $searchableFields = ['*'];

Expand All @@ -49,8 +46,6 @@ class User extends BaseUser implements HasAvatar

public function getFilamentAvatarUrl(): ?string
{
return $this->avatar_url ? Storage::url($this->avatar_url) : null ;
return $this->avatar_url ? Storage::url($this->avatar_url) : null;
}


}
53 changes: 24 additions & 29 deletions packages/user/src/Resources/UserResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,30 @@

namespace Moox\User\Resources;

use Filament\Forms\Components\Card;
use Livewire\Component;
use Filament\Forms\Form;
use Filament\Tables\Table;
use Moox\User\Models\User;
use Filament\Resources\Resource;
use Filament\Forms\Components\FileUpload;
use Filament\Forms\Components\Grid;
use Illuminate\Support\Facades\Hash;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\RichEditor;
use Filament\Forms\Components\Section;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables\Actions\DeleteBulkAction;
use Filament\Tables\Actions\EditAction;
use Filament\Tables\Actions\ViewAction;
use Filament\Tables\Columns\IconColumn;
use Filament\Tables\Columns\TextColumn;
use Illuminate\Database\Eloquent\Model;
use Filament\Forms\Components\TextInput;
use Filament\Tables\Columns\ImageColumn;
use Filament\Forms\Components\FileUpload;
use Filament\Forms\Components\RichEditor;
use Filament\Forms\Components\Split;
use Filament\Tables\Columns\SelectColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Filters\SelectFilter;
use Filament\Tables\Actions\DeleteBulkAction;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Hash;
use Livewire\Component;
use Moox\User\Models\User;
use Moox\User\Resources\UserResource\Pages\CreateUser;
use Moox\User\Resources\UserResource\Pages\EditUser;
use Moox\User\Resources\UserResource\Pages\ViewUser;
use Moox\User\Resources\UserResource\Pages\ListUsers;
use Moox\User\Resources\UserResource\Pages\CreateUser;
use Moox\User\Resources\UserResource\Pages\ViewUser;
use STS\FilamentImpersonate\Tables\Actions\Impersonate;

class UserResource extends Resource
Expand All @@ -54,8 +51,7 @@ public static function form(Form $form): Form
]),

FileUpload::make('avatar_url'),



TextInput::make('name')
->rules(['max:255', 'string'])
->required()
Expand Down Expand Up @@ -169,8 +165,8 @@ public static function form(Form $form): Form
'md' => 12,
'lg' => 12,
]),
]),
]),
]),

Section::make()->schema([
Grid::make(['default' => 0])->schema([
Expand Down Expand Up @@ -226,8 +222,8 @@ public static function form(Form $form): Form

])->statePath('data'),
]),
]);

]);
}

public static function table(Table $table): Table
Expand All @@ -236,7 +232,7 @@ public static function table(Table $table): Table
->poll('60s')
->columns([
ImageColumn::make('profile_photo_path')
->defaultImageUrl(fn ($record): string => 'https://ui-avatars.com/api/?name=' . $record->name)
->defaultImageUrl(fn ($record): string => 'https://ui-avatars.com/api/?name='.$record->name)
->circular()
->toggleable(),
TextColumn::make('name')
Expand All @@ -250,7 +246,7 @@ public static function table(Table $table): Table
TextColumn::make('first_name')
->label(__('Fullname'))
->formatStateUsing(function ($state, User $user) {
return $user->first_name . ' ' . $user->last_name;
return $user->first_name.' '.$user->last_name;
})
->toggleable()
->sortable()
Expand All @@ -260,9 +256,8 @@ public static function table(Table $table): Table
->toggleable()
->searchable()
->limit(50),
IconColumn::make('email_verified_at')
,
TextColumn::make('roles.name'),
IconColumn::make('email_verified_at'),
TextColumn::make('roles.name'),

])
->filters([
Expand All @@ -272,7 +267,7 @@ public static function table(Table $table): Table
->multiple()
->label('Language'),
])
->actions([Impersonate::make()->redirectTo(route('filament.moox.pages.profile')),ViewAction::make(), EditAction::make()])
->actions([Impersonate::make()->redirectTo(route('filament.moox.pages.profile')), ViewAction::make(), EditAction::make()])
->bulkActions([DeleteBulkAction::make()]);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/user/src/Resources/UserResource/Pages/EditUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Moox\User\Resources\UserResource\Pages;

use Filament\Actions\DeleteAction;
use Moox\User\Resources\UserResource;
use Filament\Resources\Pages\EditRecord;
use Moox\User\Resources\UserResource;
use STS\FilamentImpersonate\Pages\Actions\Impersonate;

class EditUser extends EditRecord
Expand All @@ -13,6 +13,6 @@ class EditUser extends EditRecord

protected function getHeaderActions(): array
{
return [DeleteAction::make(),Impersonate::make()->record($this->getRecord())];
return [DeleteAction::make(), Impersonate::make()->record($this->getRecord())];
}
}

0 comments on commit 9f625de

Please sign in to comment.