• JavaScriptPHPHTMLCssPythonWordPressWeb developmentLinuxMySQLAndroid
    WindowsJavaC++ / C#LayoutReactUbuntuYiiDjangoProgramming1C-Bitrix
    LaravelSystem administrationTelegramJSONDebianPostgreSQLIOSGoogleHtaccessWindows Server
    GitMacOSGoogle ChromeCMSWooСommerceBootstrapNginxSQLUnityAPI
  • Ask
  • Leaders

Categories

JavaScriptPHPHTMLCssPythonWordPressWeb developmentLinuxMySQLAndroidWindowsJavaC++ / C#LayoutReactUbuntuYiiDjangoProgramming1C-BitrixLaravelSystem administrationTelegramJSONDebianPostgreSQLIOSGoogleHtaccessWindows ServerGitMacOSGoogle ChromeCMSWooСommerceBootstrapNginxSQLUnityAPI
Programming
JavaScript PHP HTML Css Python WordPress Web development Linux MySQL Android Windows Java C++ / C# Layout React Ubuntu Yii Django Programming 1C-Bitrix Laravel System administration Telegram JSON Debian PostgreSQL IOS Google Htaccess Windows Server
Make a leaderReport
E
E
Emil Rakhmatullin2019-09-03 17:07:01
Laravel
Emil Rakhmatullin, 2019-09-03 17:07:01

How to get 2 last records from Laravel DB?

I get the last entry like this:
$news= $blog->news()->latest()->first();

Reply
Answer the question

Answer the question

In order to leave comments, you need to log in

0 answer(s)
Similar questions
A
Alexander Ivanov2018-07-30 13:55:26
Why is the update method not working in laravel controller? 1Reply
V
vlad_lutsky2018-07-31 00:59:05
What is the best way to use laravel vue? 1Reply
M
MakPET2016-03-13 17:08:36
Does a syntax error give a 500 error? 3Reply
V
Vadim Cherkashin2018-08-02 15:36:54
Does not save data to the database, what's the problem? 1Reply
S
Sergey Gutovsky2018-08-03 01:47:18
How to complete a request? 1Reply

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question

banners