예제 #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']);
 }