// Get a degree
$degree = $faker->degree(); // 'Bachelor of Science'
// Get a field of study
$field = $faker->fieldOfStudy(); // 'Computer Science'
// Get a university
$university = $faker->university(); // 'Harvard University'
// Get an education history
$education = $faker->educationHistory(2);
// [
// [
// 'degree' => 'Bachelor of Science',
// 'field' => 'Computer Science',
// 'university' => 'Stanford University',
// 'startYear' => 2014,
// 'endYear' => 2018,
// 'gpa' => '3.8/4.0'
// ],
// [
// 'degree' => 'Master of Business Administration',
// 'field' => 'Finance',
// 'university' => 'Harvard University',
// 'startYear' => 2018,
// 'endYear' => 2020,
// 'gpa' => '3.9/4.0'
// ]
// ]
// Get skills
$skill = $faker->skill('Technical'); // 'Programming'
$skillSet = $faker->skillSet(3);
// [
// ['name' => 'Programming', 'category' => 'Technical'],
// ['name' => 'Communication', 'category' => 'Soft Skills'],
// ['name' => 'Project Management', 'category' => 'Business']
// ]
// Get an inspirational quote
$quote = $faker->inspirationalQuote();
// ['quote' => 'The only way to do great work is to love what you do.', 'author' => 'Steve Jobs']
// Get just the quote text without author
$quoteText = $faker->inspirationalQuote(false);
// 'The only way to do great work is to love what you do.'
// Get specific quote types
$businessQuote = $faker->businessQuote();
$technologyQuote = $faker->technologyQuote();
$leadershipQuote = $faker->leadershipQuote();
$movieQuote = $faker->movieQuote();
$programmingQuote = $faker->programmingQuote();
// Get a random quote of any type
$randomQuote = $faker->randomQuote();
// [
// 'quote' => 'First, solve the problem. Then, write the code.',
// 'author' => 'John Johnson',
// 'type' => 'programming'
// ]
// Get multiple quotes
$quotes = $faker->quotes(3, 'business', true);
// Array of 3 business quotes with authors
// Get multiple quotes of random types
$randomQuotes = $faker->quotes(5);
// Array of 5 random quotes of different types
namespace Database\Factories;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
class UserFactory extends Factory
{
protected $model = User::class;
public function definition()
{
return [
'name' => $this->faker->name(),
'email' => $this->faker->unique()->safeEmail(),
'job_title' => $this->faker->jobTitle(),
'personality' => $this->faker->personalityTraits(3),
'favorite_quote' => $this->faker->inspirationalQuote(),
'skills' => $this->faker->skillSet(5),
'education' => $this->faker->educationHistory(2),
];
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.