Filament: CRM: Customer Management System

Screenshot 2023-11-09 at 17.36.21

No comments or questions yet...

Full project to manage customers, pipeline stages, tasks, calendar, employees, and more.

How it works

Here's a description of the main features:

Customer Table Actions - Create Tasks, Change Statuses, Add Notes

// ...
 
->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]);
})
])
])
 
// ...

Custom Table Tabs - Each of our Customers is Filtered by Pipeline Stage

Here's the code...

The FULL tutorial is available after the purchase: in the Readme file of the official repository you would get invited to.
Get the Source Code: 38 Premium Examples for $99