feat: product badges and show page layout

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Doar Mihai
2026-10-17 15:56:58 +03:00
co-authored by Claude Sonnet 5.5
parent 029689407b
commit 9920fafab6
12 changed files with 382 additions and 63 deletions
+21
View File
@@ -3,6 +3,7 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
@@ -10,6 +11,18 @@ use Illuminate\Support\Str;
class Product extends Model
{
use HasFactory;
/**
* Badge keys and their labels.
*/
public const BADGES = [
'free_tier' => 'Free tier',
'open_source' => 'Open source',
'eu_hosted' => 'EU hosted',
'eu_made' => 'EU made',
];
/**
* The attributes that are mass assignable.
*
@@ -26,6 +39,10 @@ class Product extends Model
'status',
'approved_at',
'rejected_at',
'free_tier',
'open_source',
'eu_hosted',
'eu_made',
];
/**
@@ -38,6 +55,10 @@ class Product extends Model
return [
'approved_at' => 'datetime',
'rejected_at' => 'datetime',
'free_tier' => 'boolean',
'open_source' => 'boolean',
'eu_hosted' => 'boolean',
'eu_made' => 'boolean',
];
}