Пример #1
0
 public function scopePurposes()
 {
     foreach (Purpose::all() as $purpose) {
     }
     $inventory = Bullet::where('cartridge_id', $this->id)->select(DB::raw('SUM(`inventory`) as inventory, purpose_id'))->groupBy('purpose_id')->get();
 }
Пример #2
0
 public function showManufacturers($manufacturer)
 {
     return view('bullets.index', ['cartridges' => Cartridge::all(), 'bullets' => Bullet::where('manufacturer', $manufacturer)->get(), 'sort' => 'inventory']);
 }