Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
kristi11 committed Aug 28, 2024
1 parent 7ad3ffb commit 1ae2093
Show file tree
Hide file tree
Showing 22 changed files with 210 additions and 101 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
</p>
<b>PLEASE DO KEEP IN MIND THAT THIS IS A NEW APP AND THERE WILL BE A LOT OF ROOM FOR IMPROVEMENT</b>

### **THIS REPOSITORY SHOULD BE USED ON A BRAND-NEW PROJECT**
### The app's CRUD functionality has been severally restricted in this [demonstration](https://wittyworkflow.com) app. Follow the below steps to activate CRUD functionality on the desired resources in order to achieve the desired functionality

## **THIS REPOSITORY SHOULD BE USED ON A BRAND-NEW PROJECT**

</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,15 @@ public static function table(Table $table): Table
->slideOver()
->label('View details'),
Tables\Actions\EditAction::make()
->slideOver(),
->slideOver()
->label('')
->tooltip('Edit'),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
Tables\Actions\DeleteBulkAction::make()
->label('')
->tooltip('Delete'),
]),
]);
}
Expand Down
11 changes: 8 additions & 3 deletions app/Filament/Customer/Resources/CustomerGalleryResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use App\Filament\Resources\GalleryResource;
use App\Models\Gallery;
use Filament\Forms\Form;
use Filament\Infolists\Components\ImageEntry;
use Filament\Infolists\Components\Section;
use Filament\Infolists\Components\SpatieMediaLibraryImageEntry;
use Filament\Infolists\Infolist;
Expand Down Expand Up @@ -37,6 +36,9 @@ public static function form(Form $form): Form
]);
}

/**
* @throws \Exception
*/
public static function table(Table $table): Table
{
return $table
Expand Down Expand Up @@ -72,7 +74,8 @@ public static function table(Table $table): Table
->collapsible(),
])
->filters([
SelectFilter::make('author')->relationship('service', 'name') ])
SelectFilter::make('author')->relationship('service', 'name')
])
->actions([
Tables\Actions\ViewAction::make()
->label('View service images')
Expand All @@ -82,7 +85,9 @@ public static function table(Table $table): Table
]);
// ->bulkActions([
// Tables\Actions\BulkActionGroup::make([
// Tables\Actions\DeleteBulkAction::make(),
// Tables\Actions\DeleteBulkAction::make()
// ->label('')
// ->tooltip('Delete'),
// ]),
// ]);
}
Expand Down
12 changes: 8 additions & 4 deletions app/Filament/Resources/AboutResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static function form(Form $form): Form
->schema([
Select::make('user_id')
->relationship('user', 'name')
->default(fn (): int => auth()->id())
->default(fn(): int => auth()->id())
->required()
->columnSpanFull()
->helperText(str('The **currently authenticated user** is automatically set as the user.')->inlineMarkdown()->toHtmlString())
Expand Down Expand Up @@ -72,12 +72,16 @@ public static function table(Table $table): Table
])
->actions([
Tables\Actions\EditAction::make()
->slideOver(),
->slideOver()
->label('')
->tooltip('edit'),
])
->paginated(false)
->bulkActions([
Tables\Actions\BulkActionGroup::make([
// Tables\Actions\DeleteBulkAction::make(),
// Tables\Actions\DeleteBulkAction::make()
// ->label('')
// ->tooltip('delete'),
]),
]);
}
Expand All @@ -101,7 +105,7 @@ public static function canCreate(): bool
{
$recordExists = About::exists();

return ! $recordExists;
return !$recordExists;
}

public static function canDelete(Model $record): bool
Expand Down
13 changes: 9 additions & 4 deletions app/Filament/Resources/AddressResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static function form(Form $form): Form
->schema([
Select::make('user_id')
->relationship('user', 'name')
->default(fn (): int => auth()->id())
->default(fn(): int => auth()->id())
->required()
->helperText(str('The **currently authenticated user** is automatically set as the user.')->inlineMarkdown()->toHtmlString())
->disabled()
Expand Down Expand Up @@ -106,11 +106,16 @@ public static function table(Table $table): Table
])
->actions([
Tables\Actions\EditAction::make()
->slideOver(),
->slideOver()
->label('')
->tooltip('Edit'),
])
->paginated(false)
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
// Tables\Actions\DeleteBulkAction::make()
// ->label('')
// ->tooltip('Delete'),
]),
])
->paginated(false);
Expand All @@ -127,7 +132,7 @@ public static function canCreate(): bool
{
$recordExists = Address::exists();

return ! $recordExists;
return !$recordExists;
}

public static function getPages(): array
Expand Down
22 changes: 12 additions & 10 deletions app/Filament/Resources/AppointmentResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static function form(Form $form): Form
->schema([
Select::make('user_id')
->relationship('user', 'name')
->default(fn (): int => auth()->id())
->default(fn(): int => auth()->id())
->required()
->helperText(str('The name of the user that created the appointment.')->inlineMarkdown()->toHtmlString())
->disabled()
Expand Down Expand Up @@ -83,7 +83,7 @@ public static function form(Form $form): Form
->schema([
TextInput::make('client_name')
->label('Name')
->default(fn (): string => auth()->user()->name)
->default(fn(): string => auth()->user()->name)
->required()
->helperText(str('The name of the user that created the appointment.')->inlineMarkdown()->toHtmlString())
->disabled()
Expand All @@ -93,7 +93,7 @@ public static function form(Form $form): Form
TextInput::make('client_email')
->label('Email')
->email()
->default(fn (): string => auth()->user()->email)
->default(fn(): string => auth()->user()->email)
->required()
->helperText(str('The email of the user that created the appointment.')->inlineMarkdown()->toHtmlString())
->disabled()
Expand Down Expand Up @@ -181,7 +181,7 @@ public static function table(Table $table): Table
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('client_email')
->searchable()
->url(fn ($record) => "mailto:$record->client_email")
->url(fn($record) => "mailto:$record->client_email")
->color('primary')
->label('Client email')
->toggleable(isToggledHiddenByDefault: true),
Expand Down Expand Up @@ -222,15 +222,17 @@ public static function table(Table $table): Table
])
->filtersFormColumns(2)
->actions([
Tables\Actions\ViewAction::make()
->slideOver()
->label('View details'),
Tables\Actions\EditAction::make()
->slideOver(),
->slideOver()
->label('')
->tooltip('Edit'),
])
->paginated(false)
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
Tables\Actions\DeleteBulkAction::make()
->label('')
->tooltip('Delete'),
]),
]);
}
Expand All @@ -254,7 +256,7 @@ public static function infolist(Infolist $infolist): Infolist
->label('Client name'),
TextEntry::make('client_email')
->label('Client email')
->url(fn ($record) => "mailto:$record->client_email")
->url(fn($record) => "mailto:$record->client_email")
->color('primary'),
TextEntry::make('client_phone')
->label('Client phone')
Expand Down
18 changes: 12 additions & 6 deletions app/Filament/Resources/BusinessHourResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static function form(Form $form): Form
->schema([
Select::make('user_id')
->relationship('user', 'name')
->default(fn (): int => auth()->id())
->default(fn(): int => auth()->id())
->required()
->helperText(str('The **currently authenticated user** is automatically set as the user.')->inlineMarkdown()->toHtmlString())
->disabled()
Expand Down Expand Up @@ -70,7 +70,7 @@ public static function form(Form $form): Form
->default('closed')
->requiredIf('status', true)
->markAsRequired()
->disabled(fn (Forms\Get $get): bool => ! $get('status'))
->disabled(fn(Forms\Get $get): bool => !$get('status'))
->helperText('Select the time the business opens on this day.')
->format('h:i A')
->prefixIcon('heroicon-s-lock-open')
Expand All @@ -79,7 +79,7 @@ public static function form(Form $form): Form
->default('closed')
->requiredIf('status', true)
->markAsRequired()
->disabled(fn (Forms\Get $get): bool => ! $get('status'))
->disabled(fn(Forms\Get $get): bool => !$get('status'))
->helperText('Select the time the business closes on this day.')
->format('h:i A')
->prefixIcon('heroicon-s-lock-closed')
Expand Down Expand Up @@ -128,13 +128,19 @@ public static function table(Table $table): Table
])
->actions([
Tables\Actions\ViewAction::make()
->slideOver(),
->slideOver()
->label('')
->tooltip('View'),
Tables\Actions\EditAction::make()
->slideOver(),
->slideOver()
->label('')
->tooltip('Edit'),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
// Tables\Actions\DeleteBulkAction::make(),
// Tables\Actions\DeleteBulkAction::make()
// ->label('')
// ->tooltip('Delete'),
]),
]);
}
Expand Down
12 changes: 8 additions & 4 deletions app/Filament/Resources/ContactResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static function form(Form $form): Form
->schema([
Select::make('user_id')
->relationship('user', 'name')
->default(fn (): int => auth()->id())
->default(fn(): int => auth()->id())
->required()
->columnSpanFull()
->helperText(str('The **currently authenticated user** is automatically set as the user.')->inlineMarkdown()->toHtmlString())
Expand Down Expand Up @@ -72,12 +72,16 @@ public static function table(Table $table): Table
])
->actions([
Tables\Actions\EditAction::make()
->slideOver(),
->slideOver()
->label('')
->tooltip('Edit'),
])
->paginated(false)
->bulkActions([
Tables\Actions\BulkActionGroup::make([
// Tables\Actions\DeleteBulkAction::make(),
// Tables\Actions\DeleteBulkAction::make()
// ->label('')
// ->tooltip('Delete'),
]),
]);
}
Expand All @@ -101,7 +105,7 @@ public static function canCreate(): bool
{
$recordExists = Contact::exists();

return ! $recordExists;
return !$recordExists;
}

public static function canDelete(Model $record): bool
Expand Down
22 changes: 13 additions & 9 deletions app/Filament/Resources/FAQdataResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static function form(Form $form): Form
->schema([
Select::make('user_id')
->relationship('user', 'name')
->default(fn (): int => auth()->id())
->default(fn(): int => auth()->id())
->required()
->columnSpanFull()
->helperText(str('The **currently authenticated user** is automatically set as the user.')->inlineMarkdown()->toHtmlString())
Expand All @@ -61,11 +61,11 @@ public static function table(Table $table): Table
return $table
->columns([
Tables\Columns\IconColumn::make('visibility')
->color(function ($state) {
return Visibility::from($state)->getVisibility();
})
->boolean()
->label('FAQ exists ?'),
->color(function ($state) {
return Visibility::from($state)->getVisibility();
})
->boolean()
->label('FAQ exists ?'),
Tables\Columns\TextColumn::make('content')
->html()
->label('FAQ')
Expand All @@ -77,12 +77,16 @@ public static function table(Table $table): Table
])
->actions([
Tables\Actions\EditAction::make()
->slideOver(),
->slideOver()
->label('')
->tooltip('Edit'),
])
->paginated(false)
->bulkActions([
Tables\Actions\BulkActionGroup::make([
// Tables\Actions\DeleteBulkAction::make(),
// Tables\Actions\DeleteBulkAction::make()
// ->label('')
// ->tooltip('Delete'),
]),
]);
}
Expand All @@ -106,7 +110,7 @@ public static function canCreate(): bool
{
$recordExists = FAQdata::exists();

return ! $recordExists;
return !$recordExists;
}

public static function canDelete(Model $record): bool
Expand Down
15 changes: 13 additions & 2 deletions app/Filament/Resources/FlexibilityResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Filament\Forms\Components\Toggle;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables\Actions\BulkActionGroup;
use Filament\Tables\Actions\EditAction;
use Filament\Tables\Columns\IconColumn;
use Filament\Tables\Columns\TextColumn;
Expand Down Expand Up @@ -36,7 +37,7 @@ public static function form(Form $form): Form
->schema([
Select::make('user_id')
->relationship('user', 'name')
->default(fn (): int => auth()->id())
->default(fn(): int => auth()->id())
->required()
->helperText(str('The **currently authenticated user** is automatically set as the user.')->inlineMarkdown()->toHtmlString())
->disabled()
Expand Down Expand Up @@ -85,7 +86,17 @@ public static function table(Table $table): Table
])
->actions([
EditAction::make()
->slideOver(),
->slideOver()
->label('')
->tooltip('Edit'),
])
->paginated(false)
->bulkActions([
BulkActionGroup::make([
// Tables\Actions\DeleteBulkAction::make()
// ->label('')
// ->tooltip('Delete'),
]),
]);
}

Expand Down
Loading

0 comments on commit 1ae2093

Please sign in to comment.