php-fakerHow can I generate a fake company name using Laravel Faker?
Using Laravel Faker, you can easily generate a fake company name.
Example code
$faker = Faker\Factory::create();
$companyName = $faker->company;
echo $companyName;
Output example
Jaskolski-Bergstrom
The code above creates an instance of the Faker class using the create() method, and then uses the company property of the Faker class to generate a fake company name.
Code explanation
$faker = Faker\Factory::create();
creates an instance of the Faker class.$companyName = $faker->company;
uses the company property of the Faker class to generate a fake company name.echo $companyName;
outputs the fake company name.
Helpful links
More of Php Faker
- How do I generate a zip file using PHP Faker?
- How can I generate fake data in XLSX format using PHP Faker?
- How do I check which version of Laravel Faker I am using?
- How do I generate a valid VAT number using Laravel Faker?
- How do I generate a fake year in Laravel using Faker?
- How can I generate unique data with Laravel Faker?
- How can I generate a zip code using Laravel Faker?
- How do I use PHP Faker to generate XML data?
- How can I use Faker with Laravel?
- How can I generate random words of a specific length using PHP Faker?
See more codes...