-
-
Save anonymous/3d3ffea5af84d990bdb5dfaab6787447 to your computer and use it in GitHub Desktop.
FuelingsController
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers\Vehicles; | |
use App\Helpers\CarbonFormatter; | |
use App\Http\Controllers\Controller; | |
use App\Models\Dictionaries\FuelType; | |
use App\Models\Vehicles\Fueling; | |
use Illuminate\Http\Request; | |
use Storage; | |
class FuelingsController extends Controller | |
{ | |
protected $_model; | |
public function getVehicle($id) | |
{ | |
return call_user_func($this->_model . '::findOrFail', $id); | |
} | |
public function create($vehicleId) | |
{ | |
return view('vehicles.fuelings.create', [ | |
'vehicle' => $this->getVehicle($vehicleId), | |
'fuelTypes' => FuelType::all()->pluck('title', 'id'), | |
'vehicleType' => str_plural(constant($this->_model . '::VEHICLE_TYPE_TITLE')) | |
]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment