Navigate back to the homepage

Laravel Select First Row Only

Infinitbility
Laravel
April 26th, 2021 · 1 min read
Laravel Select First Row Only

Hello Friends 👋,

Welcome To Infinitbility! ❤️

this article explain how to Select only first row or single row in laravel.

laravel provide first() method to Select only single row using first() you will not required to write like this $array[0].

If you just need to retrieve a single row from a database table, you may use the DB facade’s first method. This method will return a single stdClass object:

1$user = DB::table('users')->where('name', 'John')->first();
2
3return $user->email;

Thanks For Reading…

Looking For React Native Tutorial?

we are trying to create the best Tutorial for react native developers.

When you want a daily updates about React Native Tutorial or infinitbility update subscribe to our newsletter.

Read React Native Tutorial

Request New Tutorial or Article on mail [email protected]

Join our email list and get notified about new content

No worries, I respect your privacy and I will never abuse your email.

Every week, on Tuesday, you will receive a list of free tutorials I made during the week (I write one every day) and news on other training products I create.

More articles from Infinitbility

Task transform dex archive with dex merger for debug failed in react native

Task transform dex archive with dex merger for debug failed in react native

Task transform Dex Archive With Dex Merger For Debug FAILED In React Native

April 25th, 2021 · 1 min read
React native video example with custom control

React native video example with custom control

Create video player in react native

April 24th, 2021 · 1 min read
© 2020–2021 Infinitbility
Disclaimer
Link to $https://medium.com/infinitbilityLink to $https://www.facebook.com/InfinitbilityLink to $https://github.com/infinitbilityLink to $https://twitter.com/infinitbilityLink to $https://www.buymeacoffee.com/infinitbilityLink to $mailto:[email protected]