$email], [ 'name' => $name, 'password' => Hash::make($password), ] ); /** fill the Sabre-friendly columns once we know the ULID */ $user->update([ 'uri' => 'principals/'.$user->id, 'displayname' => $user->name, ]); /** sample caldav data */ $calId = DB::table('calendars')->insertGetId([ 'synctoken' => 1, 'components' => 'VEVENT', ]); $instanceId = DB::table('calendarinstances')->insertGetId([ 'calendarid' => $calId, 'principaluri' => $user->uri, // uses new column 'uri' => Str::uuid(), 'displayname' => 'Sample Calendar', 'description' => 'Seeded calendar', 'calendarorder' => 0, 'calendarcolor' => '#007db6', 'timezone' => config('app.timezone', 'UTC'), ]); DB::table('calendar_meta')->updateOrInsert( ['calendar_id' => $instanceId], ['color' => '#007AFF'] ); /** sample vevent */ $uid = Str::uuid().'@kithkin.lan'; $start = Carbon::now(); $end = Carbon::now()->addHour(); $ical = <<utc()->format('Ymd\\THis\\Z')} DTSTART:{$start->format('Ymd\\THis')} DTEND:{$end->format('Ymd\\THis')} SUMMARY:Seed Event DESCRIPTION:Automatically seeded event LOCATION:Home Office END:VEVENT END:VCALENDAR ICS; $eventId = DB::table('calendarobjects')->insertGetId([ 'calendarid' => $calId, 'uri' => Str::uuid().'.ics', 'lastmodified' => time(), 'etag' => md5($ical), 'size' => strlen($ical), 'componenttype' => 'VEVENT', 'uid' => $uid, 'calendardata' => $ical, ]); DB::table('event_meta')->updateOrInsert( ['event_id' => $eventId], [ 'title' => 'Seed Event', 'description' => 'Automatically seeded event', 'location' => 'Home Office', 'all_day' => false, 'category' => 'Demo', 'start_at' => $start, 'end_at' => $end, 'created_at' => now(), 'updated_at' => now(), ] ); } }