Create Dummy Data Using Laravel Tinker

<?php
use App\User;
use Faker\Generator as Faker;
use Illuminate\Support\Str;
factory->define(User::class, function (Faker $faker) { return [
‘name’ => $faker->name,
‘email’ => $faker->unique()->safeEmail,
‘email_verified_at’ => now(),
‘password’ => ‘$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi’, // password
‘remember_token’ => Str::random(10), ];
});
php artisan tinker 
factory(App\User::class, 200)->create();
<?php  use App\User; 
use Faker\Generator as Faker;
use Illuminate\Support\Str;
$factory->define(User::class, function (Faker $faker) {
return [
'name' => $faker->name,
'email' => $faker->unique()->safeEmail,
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'remember_token' => Str::random(10),
];
});
$factory->define(App\Blog::class, function (Faker $faker) { return [
'title' => $faker->name,
'Description' => $faker->text,
];
});
  • Lorem text
  • Person i.e. titles, names, gender etc.
  • Addresses
  • Text
  • DateTime
  • Colour
  • Files
  • Images
php artisan tinker 
factory(App\Blog::class, 50)->create();

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Websolutionstuff

Websolutionstuff

96 Followers

I am Laravel and PHP Developer. I have also Good Knowledge of JavaScript, jQuery, Bootstrap and REST API.