Files
InvoiceShelf/database/factories/CompanyFactory.php
Darko Gjorgjijoski 6b80b5f48d Change namespace
2024-01-27 23:53:20 +01:00

33 lines
694 B
PHP

<?php
namespace Database\Factories;
use InvoiceShelf\Models\Company;
use InvoiceShelf\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
class CompanyFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Company::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'unique_hash' => str_random(20),
'name' => $this->faker->name(),
'owner_id' => User::where('role', 'super admin')->first()->id,
'slug' => $this->faker->word
];
}
}