Extend Laravel's default Faker with additional data providers
bishwajitcadhikary/laravel-faker-extended is a Laravel package for extend laravel's default faker with additional data providers.
It currently has 0 GitHub stars and 38 downloads on Packagist (latest version v1.0.0).
Install it with composer require bishwajitcadhikary/laravel-faker-extended.
Discover more Laravel packages by bishwajitcadhikary
or browse all Laravel packages to compare alternatives.
Last updated
Extend Laravel's default Faker with additional data providers for more realistic test data generation.
You can install the package via composer:
composer require bishwajitcadhikary/laravel-faker-extended
The package will automatically register its service provider.
Once installed, the extended Faker providers will be automatically available in your Laravel application. You can use them in your database seeders, factories, or any other place where you use Faker.
// Use in a factory or seeder
$faker = app(\Faker\Generator::class);
// Get a job title
$jobTitle = $faker->jobTitle(); // 'Senior Software Engineer'
// Get personality traits
$trait = $faker->personalityTraits(); // 'Analytical'
$traits = $faker->personalityTraits(3); // ['Creative', 'Detail-oriented', 'Innovative']
// Get a personality profile
$profile = $faker->personalityProfile();
// [
// 'strengths' => ['Analytical', 'Creative'],
// 'weaknesses' => ['Perfectionist'],
// 'mbti' => 'INTJ'
// ]
// Get an age
$age = $faker->age(25, 45); // 32
// Get a company type
$companyType = $faker->companyType(); // 'LLC'
// Get a business sector
$sector = $faker->sector(); // 'Technology'
// Get a mission statement
$mission = $faker->missionStatement(15); // 'Our mission is to...'
// Get company values
$value = $faker->companyValues(1); // 'Innovation'
$values = $faker->companyValues(3); // ['Integrity', 'Teamwork', 'Excellence']
// Get funding information
$fundingRound = $faker->fundingRound(); // 'Series A'
$fundingAmount = $faker->fundingAmount(5, 20); // '$12.5M'
$fundingInfo = $faker->fundingInfo();
// [
// 'round' => 'Series A',
// 'amount' => '$12.5M',
// 'investors' => 3,
// 'valuation' => '$75M',
// 'date' => '2023-05-15'
// ]
// Get a social media handle
$handle = $faker->socialMediaHandle(); // '@johndoe'
// Get a social media platform
$platform = $faker->socialPlatform(); // 'Twitter'
// Get social profiles
$profiles = $faker->socialProfiles(2);
// [
// 'Twitter' => '@johndoe',
// 'LinkedIn' => '@johndoe'
// ]
// Get programming languages
$language = $faker->programmingLanguage(); // 'Python'
$languages = $faker->programmingLanguages(3); // ['JavaScript', 'Python', 'PHP']
// Get tech stack
$techStack = $faker->techStack();
// [
// 'frontend' => 'React',
// 'backend' => 'Laravel',
// 'database' => 'PostgreSQL',
// 'languages' => ['JavaScript', 'PHP', 'Python']
// ]
// Get a startup hub
$hub = $faker->startupHub(); // 'San Francisco'
// Get a neighborhood
$neighborhood = $faker->neighborhood(); // 'Financial District'
// Get a complete office location
$officeLocation = $faker->officeLocation();
// [
// 'type' => 'Headquarters',
// 'building' => '123',
// 'street' => 'Main St',
// 'neighborhood' => 'Financial District',
// 'city' => 'San Francisco',
// 'zipcode' => '94105',
// 'country' => 'United States',
// 'coordinates' => [
// 'latitude' => 37.7749,
// 'longitude' => -122.4194
// ]
// ]
// Get company locations
$locations = $faker->companyLocations(2);
// [
// [
// 'city' => 'San Francisco',
// 'type' => 'Headquarters',
// 'employees' => 250
// ],
// [
// 'city' => 'New York',
// 'type' => 'Sales Office',
// 'employees' => 30
// ]
// ]
// 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),
];
}
}
The MIT License (MIT). Please see License File for more information.