Is there anyways to order the limited posts in Laravel?

|
kindatired 2021-11-27 13:33:33
I think it will do the trick.
GDFNSC 2021-11-27 13:33:41
You could do a symlink pointing the directory to the you need
kindatired 2021-11-27 13:36:04
GDFNSC 2021-11-27 13:33:41
You could do a symlink pointing the directory to the you need

Thank you Gabriel, done for Redis, and Imagick.

Not for Xdebug.
digging again, always xDebug is a big BUG…to me lol

kindatired 2021-11-27 13:37:56
pecl uninstall xdebug
pecl install xdebug

lets see. what this does.

kindatired 2021-11-27 13:39:14
kindatired 2021-11-27 13:37:56
pecl uninstall xdebug
pecl install xdebug

lets see. what this does.

Done.

kindatired 2021-11-27 13:39:24
Muchas gracias Gabriel.
GDFNSC 2021-11-27 13:41:31
kindatired 2021-11-27 13:39:14
Done.

Great!!!

David Kamau 2021-11-27 14:05:40
praveenl_me 2021-11-26 06:52:57
I’m looking for laravel developer

If anyone available to work on part time

Pls let me know

I’m available

2021-11-27 14:18:06
Is there anyways to order the limited posts in Laravel?

For example, I want to get the last 100 posts, and then, order them by another column.

> Note: I do not want to order the collection result; I want my SQL query to do that!

2021-11-27 14:24:02
Sairam1997s 2021-11-26 21:35:31
First where condition is not considering

change it to:

‘created_at’, ‘>’, now()->subWeek()

GDFNSC 2021-11-27 14:31:17
2021-11-27 14:18:06
Is there anyways to order the limited posts in Laravel?

For example, I want to get the last 100 posts, and then, order them by another column.

> Note: I do not want to order the collection result; I want my SQL query to do that!

Use ->orderBy(‘created_at’)->orderBy(‘another_column’)->limit(100)

2021-11-27 14:32:23
GDFNSC 2021-11-27 14:31:17
Use ->orderBy(‘created_at’)->orderBy(‘another_column’)->limit(100)

You didn’t understand the question correctly

2021-11-27 14:33:14
GDFNSC 2021-11-27 14:31:17
Use ->orderBy(‘created_at’)->orderBy(‘another_column’)->limit(100)

I want to reorder my last inserted items after LIMIt clause, by another column.

For example, I want to reorder my last 100 posts by another column which is view.

id | title | view | created_at

Something like:

Post::latest()->limit(100)->orderByDesc(‘view’)

2021-11-27 14:35:01
GDFNSC 2021-11-27 14:31:17
Use ->orderBy(‘created_at’)->orderBy(‘another_column’)->limit(100)

I’ve tried:

Post::latest()->limit(4 * 3)->get()->sortByDesc(‘view’)->take(4);

And it works fine, but it uses Laravel methods to order the collection; for some reason, I want the SQL to do that.

GDFNSC 2021-11-27 14:39:15
2021-11-27 14:33:14
I want to reorder my last inserted items after LIMIt clause, by another column.

For example, I want to reorder my last 100 posts by another column which is view.

id | title | view | created_at

Something like:

Post::latest()->limit(100)->orderByDesc(‘view’)

Limit is the last clause to use in sql query. So maybe you will not be able to do so.

https://dev.mysql.com/doc/refman/8.0/en/limit-optimization.html

2021-11-27 14:41:52
GDFNSC 2021-11-27 14:39:15
Limit is the last clause to use in sql query. So maybe you will not be able to do so.

https://dev.mysql.com/doc/refman/8.0/en/limit-optimization.html

Hmmm; I couldn’t find any answers myself; I think you’re right.

2021-11-27 14:42:51
GDFNSC 2021-11-27 14:39:15
Limit is the last clause to use in sql query. So maybe you will not be able to do so.

https://dev.mysql.com/doc/refman/8.0/en/limit-optimization.html

Another question, as you my know, when you fetch data using eloquent ORM, Laravel returns a collection.

Is there any ways to get an array of collections instead?

->toArray converts everything to array, even the child collections!

$posts = Post::all();
// post is a collection

I want the $post to be something like this:

[
collection
collection
collection

]

Bhupendra Rajput 2021-11-27 15:51:22
Best approach required in laravel project any have a guide
Sohan Kumar 2021-11-27 16:16:44
Looking for Laravel Developer
Ping me if you are freelancer/Intern/Developer
osama2009x 2021-11-27 17:07:38
Best fronted for laravel?
osama2009x 2021-11-27 17:07:48
Is it angular
Rahaf Dakkak 2021-11-27 18:06:32
laravel_discuss-100918.jpg

osama2009x 2021-11-27 18:08:25
osama2009x 2021-11-27 17:07:38
Best fronted for laravel?

؟؟

Sunil Negi 2021-11-27 18:35:10
praveenl_me 2021-11-26 06:52:57
I’m looking for laravel developer

If anyone available to work on part time

Pls let me know

I am interested

naveen5566 2021-11-27 19:00:38
How to implement stripe subscription api using laravel and MySQL
Please help me thanks
rebory 2021-11-27 19:10:50
Wasee 2021-11-26 17:21:35
What is the name of extension ??
Import class

use php storm u never need anyone php storm away for help you

Nurullah Demirel 2021-11-27 20:04:14
Hello everyone How do I get a service to use an interface without using the constructor method in symfony
Kennygendowed 2021-11-27 20:16:40
hello pls does any one know how to serialize $request body in Laravel ?
JasurBek916 2021-11-27 20:30:41
Kennygendowed 2021-11-27 20:16:40
hello pls does any one know how to serialize $request body in Laravel ?

$data = $request->all();

$data[‘value’];

Kennygendowed 2021-11-27 20:36:04
ok thanks but pls would I be correct by doing this

$data=array(
“firstname”=>$request->fullname,
“email”=>$request->email
);

pls is $data; now serialized ??

VishwanathTK 2021-11-27 20:38:51
https://link.medium.com/YFvuVBmrrlb

7 JavaScript Functions to Master Objects Manipulation and Make Your Code CleanerMedium
Find out an object’s length, programmatically add (or remove properties), change specific properties values, and more.
JasurBek916 2021-11-27 20:41:54
Kennygendowed 2021-11-27 20:36:04
ok thanks but pls would I be correct by doing this

$data=array(
“firstname”=>$request->fullname,
“email”=>$request->email
);

pls is $data; now serialized ??

Write in the correct way, everyone writes like that

$data = $request->all();

$data[‘value’];

Kennygendowed 2021-11-27 20:42:44
ok thanks
Abbas_roholamin 2021-11-27 20:52:37
See line 68 wath method you called
Pankaj Kalal 2021-11-27 21:08:56
I Need Node Developer
9687142724 please call
Pankaj
|