jonnybarnes.uk/database/seeders/ContactsTableSeeder.php

40 lines
1 KiB
PHP
Raw Normal View History

2016-05-19 15:01:28 +01:00
<?php
2020-10-17 17:15:06 +01:00
namespace Database\Seeders;
use App\Models\Contact;
2016-05-19 15:01:28 +01:00
use Illuminate\Database\Seeder;
use Illuminate\FileSystem\FileSystem;
2016-05-19 15:01:28 +01:00
class ContactsTableSeeder extends Seeder
{
/**
2023-02-18 09:34:57 +00:00
* Seed the contacts table.
*
* @psalm-suppress PossiblyUnusedMethod
2016-05-19 15:01:28 +01:00
*/
2023-02-18 09:34:57 +00:00
public function run(): void
2016-05-19 15:01:28 +01:00
{
2017-07-17 17:07:08 +01:00
Contact::create([
2016-05-19 15:01:28 +01:00
'nick' => 'tantek',
'name' => 'Tantek Çelik',
2016-05-19 15:01:28 +01:00
'homepage' => 'http://tantek.com',
'twitter' => 't',
]);
2017-07-17 17:07:08 +01:00
Contact::create([
2016-05-19 15:01:28 +01:00
'nick' => 'aaron',
'name' => 'Aaron Parecki',
'homepage' => 'https://aaronparecki.com',
2017-07-17 17:07:08 +01:00
'facebook' => '123456',
2016-05-19 15:01:28 +01:00
]);
$fs = new FileSystem();
2022-07-09 10:08:26 +01:00
if (! $fs->exists(public_path('assets/profile-images/aaronparecki.com'))) {
$fs->makeDirectory(public_path('assets/profile-images/aaronparecki.com'));
}
$fs->copy(
base_path('tests/aaron.png'),
public_path('assets/profile-images/aaronparecki.com/image')
);
2016-05-19 15:01:28 +01:00
}
}