Answers for "eloquent orderbyraw json column"

PHP
1

orderby text values eliquent laravel

orderByRaw("FIELD(clan_rank , 'Owner', 'Admin', 'Member') ASC");
Posted by: Guest on September-03-2021
0

laravel sortby relationship column

add the code to relationship in the method of the model
   public function room(){
      return $this->hasMany(room::class,  'id')->orderBy('id', 'DESC') ;
}
Posted by: Guest on July-22-2021

Browse Popular Code Answers by Language