public function getWeighInEntryData()
 {
     $fishingCategories = array_filter((new CategoryTransformer())->transformCollection(Category::all()->toArray()));
     $fishingLocations = array_filter((new LocationTransformer())->transformCollection(Location::all()->toArray()));
     $fishingSectors = array_filter((new SectorTransformer())->transformCollection(Sector::all()->toArray()));
     $speciesList = array_filter((new SpeciesTransformer())->transformCollection(Species::with(['type', 'weights'])->get()->toArray()));
     return $this->respond(['fishingCategories' => $fishingCategories ?: null, 'fishingLocations' => $fishingLocations ?: null, 'fishingSectors' => $fishingSectors ?: null, 'speciesList' => $speciesList ?: null]);
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Category::create(['name' => 'Weigh and Release', 'short_name' => 'W/R', 'description' => 'Weigh and Release category description.']);
     Category::create(['name' => 'Artificial Lure', 'short_name' => 'A/L', 'description' => 'Artificial Lure category description.']);
 }
 /**
  * @return mixed
  */
 public function index()
 {
     $categories = Category::orderBy('id')->get();
     return $this->respond(['data' => $this->categoriesTransformer->transformCollection($categories->all())]);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $category = Category::findOrFail($id);
     $categoryName = $category->name;
     $category->delete();
     flash()->success('Success!', "{$categoryName} category has been created!");
     return redirect(route('admin.settings.fishing.categories.index'));
 }