Ejemplo n.º 1
0
 public function findLatest($take = 10)
 {
     return Category::with(['employees' => function ($q) use($take) {
         $q->take($take);
         $q->orderBy('created_at', 'desc');
     }, 'employees.user'])->get();
 }
Ejemplo n.º 2
0
 public function run()
 {
     Category::create(['id' => 1, 'name' => 'Backend developers', 'slug' => 'backend-developers']);
     Category::create(['id' => 2, 'name' => 'Frontend developers', 'slug' => 'frontend-developers']);
     Category::create(['id' => 3, 'name' => 'Designer', 'slug' => 'designer']);
 }
Ejemplo n.º 3
0
 public function run()
 {
     Category::create(['id' => 1, 'name' => 'Senior Analyst Developer', 'slug' => 'senior-analyst-developer']);
     Category::create(['id' => 2, 'name' => 'Functional Analyst', 'slug' => 'functional-analyst']);
     Category::create(['id' => 3, 'name' => 'Document', 'slug' => 'document']);
 }