2016-05-19 15:01:28 +01:00
|
|
|
<?php
|
|
|
|
|
2020-10-17 17:15:06 +01:00
|
|
|
namespace Database\Seeders;
|
|
|
|
|
2017-12-22 14:28:41 +00:00
|
|
|
use App\Models\Contact;
|
2016-05-19 15:01:28 +01:00
|
|
|
use Illuminate\Database\Seeder;
|
2019-03-16 21:48:54 +00:00
|
|
|
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.
|
2023-07-28 11:48:07 +01:00
|
|
|
*
|
|
|
|
* @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',
|
2017-07-17 17:25:53 +01:00
|
|
|
'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
|
|
|
]);
|
2019-03-16 21:48:54 +00:00
|
|
|
$fs = new FileSystem();
|
2022-07-09 10:08:26 +01:00
|
|
|
if (! $fs->exists(public_path('assets/profile-images/aaronparecki.com'))) {
|
2019-03-16 21:48:54 +00:00
|
|
|
$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
|
|
|
}
|
|
|
|
}
|