Files
wticreatorstudio/Modules/JobPortal/Database/Seeders/CompaniesTableSeeder.php
T
2024-02-12 22:54:20 -05:00

65 lines
3.3 KiB
PHP

<?php
namespace Modules\JobPortal\Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
class CompaniesTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$users = \App\Models\User::where('role_id', 101)->take(12)->get();
$company_name = ['Netflix','Opendoor','Checkr','Mural','Astronomer','Figma','Stripe','Invision','Samsung','Nokia','VinFast','Apple'];
$maps = [
'map_lat' => ['40.94401669296697','40.77055783505125','40.7427837','40.70437865245596','40.641311','41.080938','41.079386','40.77055783505125','40.7427837','40.70437865245596','40.641311', '40.94401669296697'],
'map_lng' => ['-74.16938781738281','-74.26002502441406','-73.11445617675781','-73.98674011230469','-73.778139','-73.535957','-73.519478','-74.16938781738281','-74.26002502441406','-73.11445617675781','-73.98674011230469','-73.778139']
];
foreach ($users as $key => $user)
{
$category = \Modules\JobPortal\Entities\Category::where('status','publish')->inRandomOrder()->first();
$name = $company_name[$key];
DB::table('jp_companies')->insert(
[
'name' => $name,
'slug'=>Str::slug($name),
'email' => $user->email,
'phone' => '112 666 888',
'website'=> 'https://'.Str::slug($name).'.com',
'cover_id'=>2,
'founded_in'=>date("Y-m-d"),
'allow_search' => 1,
'owner_id'=>$user->id,
'category_id'=>$category ? $category->id : 0,
'team_size'=>1,
'map_lat' => $maps['map_lat'][$key],
'map_lng' => $maps['map_lng'][$key],
'about'=>'<h4>Hello! This is my story.</h4>
<p>Hello! I am a Seattle/Tacoma, Washington area graphic designer with over 6 years of graphic design experience. I specialize in designing infographics, icons, brochures, and flyers.</p>
<ul class="instructor_estimate">
<li>Included in my estimate:</li>
<li>Custom illustrations</li>
<li>Stock images</li>
<li>Any final files you need</li>
</ul>
<p>If you have a specific budget or deadline, let me know and I will work with you!</p>',
'social_media' => '{"skype":"bookingcore.org","facebook":"https:\/\/bookingcore.org\/","twitter":"https:\/\/bookingcore.org\/","instagram":"https:\/\/bookingcore.org\/","pinterest":"https:\/\/bookingcore.org\/","dribbble":"https:\/\/bookingcore.org\/","google":"https:\/\/bookingcore.org\/"}',
'city'=>'London',
'country' => 'UK',
'address'=>'Washington',
'status' => 'publish',
'location_id'=>1,
'created_at' => date("Y-m-d H:i:s"),
'is_featured'=>rand(0,1)
]);
}
}
}