Full project to manage customers, pipeline stages, tasks, calendar, employees, and more.
Here's a description of the main features:
// ... ->actions([ Tables\Actions\ActionGroup::make([ Tables\Actions\EditAction::make() ->hidden(fn($record) => $record->trashed()), Tables\Actions\DeleteAction::make(), Tables\Actions\RestoreAction::make(), Tables\Actions\Action::make('Move to Stage') ->hidden(fn($record) => $record->trashed()) ->icon('heroicon-m-pencil-square') ->form([ Forms\Components\Select::make('pipeline_stage_id') ->label('Status') ->options(PipelineStage::pluck('name', 'id')->toArray()) ->default(function (Customer $record) { $currentPosition = $record->pipelineStage->position; return PipelineStage::where('position', '>', $currentPosition)->first()?->id; }), Forms\Components\Textarea::make('notes') ->label('Notes') ]) ->action(function (Customer $customer, array $data): void { $customer->pipeline_stage_id = $data['pipeline_stage_id']; $customer->save(); $customer->pipelineStageLogs()->create([ 'pipeline_stage_id' => $data['pipeline_stage_id'], 'notes' => $data['notes'], 'user_id' => auth()->id() ]); Notification::make() ->title('Customer Pipeline Updated') ->success() ->send(); }), Tables\Actions\Action::make('Add Task') ->icon('heroicon-s-clipboard-document') ->form([ Forms\Components\RichEditor::make('description') ->required(), Forms\Components\Select::make('user_id') ->preload() ->searchable() ->relationship('employee', 'name'), Forms\Components\DatePicker::make('due_date') ->native(false), ]) ->action(function (Customer $customer, array $data) { $customer->tasks()->create($data); Notification::make() ->title('Task created successfully') ->success() ->send(); }), Tables\Actions\Action::make('Create Quote') ->icon('heroicon-m-book-open') ->url(function ($record) { return CreateQuote::getUrl(['customer_id' => $record->id]); }) ])]) // ...
Here's the code...