feat: L'Ami Fiduciaire V1.0.0 — full codebase with Story 0.1 complete

Initial commit of the L'Ami Fiduciaire SaaS platform built on Laravel 12,
Vue 3, Inertia.js 2, and Tailwind CSS 4.

Story 0.1 (rename folders to declarations in database) is implemented and
code-reviewed: migration, rollback, and 6 Pest tests all passing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 23:33:10 +00:00
commit 35545c2a8f
1517 changed files with 246774 additions and 0 deletions

89
app/Models/Workspace.php Normal file
View File

@@ -0,0 +1,89 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Str;
use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity;
class Workspace extends Model
{
/** @use HasFactory<\Database\Factories\WorkspaceFactory> */
use HasFactory, SoftDeletes, LogsActivity;
/**
* The attributes that are mass assignable.
*
* @var list<string>
*/
protected $fillable = [
'name',
'slug',
];
/**
* Boot the model.
*/
protected static function boot(): void
{
parent::boot();
static::creating(function (Workspace $workspace) {
if (empty($workspace->slug)) {
$workspace->slug = Str::slug($workspace->name);
}
});
static::updating(function (Workspace $workspace) {
if (empty($workspace->slug)) {
$workspace->slug = Str::slug($workspace->name);
}
});
}
/**
* Get the clients for the workspace.
*
* @return HasMany<Client>
*/
public function clients(): HasMany
{
return $this->hasMany(Client::class);
}
/**
* Get the folders for the workspace.
*
* @return HasMany<Folder>
*/
public function folders(): HasMany
{
return $this->hasMany(Folder::class);
}
/**
* The users that belong to the workspace.
*
* @return BelongsToMany<User>
*/
public function users(): BelongsToMany
{
return $this->belongsToMany(User::class, 'workspace_user')
->using(WorkspaceUser::class)
->withPivot('role')
->withTimestamps();
}
public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults()
->logFillable()
->logOnlyDirty()
->dontSubmitEmptyLogs();
}
}