This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type With<Model, Relation extends string> = | |
Relation extends `${infer First}.${infer Rest}` | |
? Omit<Model, First> & {[K in First]: With<NonNullable<Model[First]>, Rest>} | |
: Relation extends keyof Model | |
? Omit<Model, Relation> & Required<Pick<Model, Relation>> | |
: never |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Traits; | |
use App\Models\User; | |
use Illuminate\Http\Request; | |
use Illuminate\Pagination\LengthAwarePaginator; | |
use Illuminate\Support\Facades\DB; | |
trait MultiModelPagination |