Apply where condition directly with column name and directly get the value

Category:
Laravel
Tags:
Laravel

Sreerag Nair
6 months ago

1. Used to get the details from the table, without writing the column name in where condition

$user = User::whereEmail('jhon@yopmail.com');

2. Used to get particular value only directly inside the variable.

$user = User::whereEmail('jhon@yopmail.com')->value('jhon@yopmail.com');
DevZone
Made by developer, Made for developers