tinker laravel

Tinker with the Data ( laravel )

are you familiar to the word tinker ?
Basically tinker helps you to read quickly from database & insert , delete data . Laravel artisan’s tinker is a repl (read-eval-print loop). A repl translates to read-eval-print-loop, and it is an interactive language shell. It takes in a single user input, evaluates it, and returns the result to the user.

php artisan tinker

You can create seeder with tinker ~~seeding details

factory(App\User::class,50)->create();

you can read all users

App\User::all();

If you want users count

App\User::count();


Inser New User

$user = new App\User;
$user->name = "Hello laravel";
$user->email = "hello@hellolaravel.com";
$user->password = Hash::make('password');
$user->save();

Delete any user

$user = App\User::find(1);
$user->delete();

Stay with Hello Laravel

Like what you read? Give Mostafa Kamal a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.