This commit is contained in:
gholak tala
2026-01-24 14:03:11 +00:00
parent 7dcd83715a
commit eb26afbcb3
224 changed files with 32652 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
<?php
return [
'sample_one' => [
'model' => \App\MyModel::class,
'cols' => "name,code",
'select' => ['id as value', 'name as label']
],
'sample_two' => [
'fn' => function ($query) {
return \App\DB\MyModel::whereHas('cls', function ($q) {
return $q->where('term_id', 2)->where('teacher_id', 1);
})
->select(['id as value', 'title as label'])
->where('title', 'LIKE', '%' . $query . '%')
->orWhere('code', 'LIKE', '%' . $query . '%')
->get()
->toArray();
},
],
'sample_three' => [
'model' => \App\DB\MyModel::class,
'cols' => "title",
'where' => [['sts', '>', '0']],
'select' => ['id as value', 'title as label']
],
'sample_four' => [
'model' => \App\DB\MyModel::class,
'cols' => "title",
'where' => [['w', 'course_level']],
'select' => ['id as value', 'title as label']
]
];