100 lines
3.6 KiB
PHP
100 lines
3.6 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Carbon\Carbon;
|
|
|
|
class GalleryMemberSeeder extends Seeder
|
|
{
|
|
public function run()
|
|
{
|
|
$memberships = [
|
|
// Maya (collectionneuse) invitée à voir plusieurs galeries privées
|
|
[
|
|
'gallery_id' => 3, // Galerie privée de Van Gogh
|
|
'user_id' => 6, // Maya
|
|
'role' => 'viewer',
|
|
'status' => 'accepted',
|
|
'invited_at' => Carbon::now()->subDays(15),
|
|
'updated_at' => Carbon::now()->subDays(12),
|
|
],
|
|
[
|
|
'gallery_id' => 7, // Galerie privée de Monet
|
|
'user_id' => 6, // Maya
|
|
'role' => 'viewer',
|
|
'status' => 'accepted',
|
|
'invited_at' => Carbon::now()->subDays(20),
|
|
'updated_at' => Carbon::now()->subDays(18),
|
|
],
|
|
|
|
// Collaborations entre artistes
|
|
[
|
|
'gallery_id' => 6, // Galerie collaborative de Maya
|
|
'user_id' => 1, // Monet invité comme contributeur
|
|
'role' => 'editor',
|
|
'status' => 'accepted',
|
|
'invited_at' => Carbon::now()->subDays(10),
|
|
'updated_at' => Carbon::now()->subDays(8),
|
|
],
|
|
[
|
|
'gallery_id' => 6, // Galerie collaborative de Maya
|
|
'user_id' => 5, // Picasso invité comme contributeur
|
|
'role' => 'editor',
|
|
'status' => 'accepted',
|
|
'invited_at' => Carbon::now()->subDays(9),
|
|
'updated_at' => Carbon::now()->subDays(7),
|
|
],
|
|
[
|
|
'gallery_id' => 6, // Galerie collaborative de Maya
|
|
'user_id' => 2, // Frida invitée mais n'a pas encore répondu
|
|
'role' => 'editor',
|
|
'status' => 'pending',
|
|
'invited_at' => Carbon::now()->subDays(5),
|
|
'updated_at' => Carbon::now()->subDays(5),
|
|
],
|
|
|
|
// Leonardo donne accès à Van Gogh à sa galerie pour inspiration
|
|
[
|
|
'gallery_id' => 4, // Galerie de Leonardo
|
|
'user_id' => 3, // Van Gogh
|
|
'role' => 'viewer',
|
|
'status' => 'accepted',
|
|
'invited_at' => Carbon::now()->subDays(25),
|
|
'updated_at' => Carbon::now()->subDays(22),
|
|
],
|
|
|
|
// Picasso refuse l'accès à sa galerie à un utilisateur
|
|
[
|
|
'gallery_id' => 5, // Galerie de Picasso
|
|
'user_id' => 4, // Leonardo
|
|
'role' => 'viewer',
|
|
'status' => 'rejected',
|
|
'invited_at' => Carbon::now()->subDays(8),
|
|
'updated_at' => Carbon::now()->subDays(6),
|
|
],
|
|
|
|
// Invitations en attente
|
|
[
|
|
'gallery_id' => 1, // Galerie de Monet
|
|
'user_id' => 2, // Frida
|
|
'role' => 'viewer',
|
|
'status' => 'pending',
|
|
'invited_at' => Carbon::now()->subDays(3),
|
|
'updated_at' => Carbon::now()->subDays(3),
|
|
],
|
|
[
|
|
'gallery_id' => 2, // Galerie de Frida
|
|
'user_id' => 3, // Van Gogh
|
|
'role' => 'viewer',
|
|
'status' => 'pending',
|
|
'invited_at' => Carbon::now()->subDays(2),
|
|
'updated_at' => Carbon::now()->subDays(2),
|
|
],
|
|
];
|
|
|
|
DB::table('gallery_members')->insert($memberships);
|
|
}
|
|
}
|