本文整理汇总了PHP中Vehicle::withTrashed方法的典型用法代码示例。如果您正苦于以下问题:PHP Vehicle::withTrashed方法的具体用法?PHP Vehicle::withTrashed怎么用?PHP Vehicle::withTrashed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vehicle
的用法示例。
在下文中一共展示了Vehicle::withTrashed方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: download
public function download($id)
{
$invoiceInfo = Invoice::find($id);
$invoiceElements = InvoiceElement::getInvoiceElements($id);
$employeeInfo = Employee::withTrashed()->find($invoiceElements[0]->employee_fk);
$elementData = [];
foreach ($invoiceElements as $element) {
$price = Vehicle::withTrashed()->where('id', '=', $element->vehicle_fk)->pluck('price');
$type = Vehicle::withTrashed()->where('id', '=', $element->vehicle_fk)->pluck('type');
$elementData[$element->vehicle_fk] = ['type' => $type, 'price' => $price];
}
$pdf = PDF::loadView('invoice.invoice', ['invoiceInfo' => $invoiceInfo, 'invoiceElements' => $invoiceElements, 'elementData' => $elementData, 'employeeInfo' => $employeeInfo]);
return $pdf->download($invoiceInfo->date . ' - ' . $invoiceInfo->bill_to . '.pdf');
}
示例2: vehicleHistory
public function vehicleHistory($id)
{
$oldVehicleIds = Vehicle::getVehicleHistory($id);
foreach ($oldVehicleIds as $oldVehicleId) {
$oldVehicleData[] = Vehicle::withTrashed()->find($oldVehicleId);
}
$currentVehicle = end($oldVehicleIds);
$data = compact('oldVehicleData', 'currentVehicle');
//echo "<pre>";
//print_r($oldVehicleData);
return View::make('vehicle.history', $data);
}
示例3: function
<?php
Route::get('in', function () {
Auth::attempt(['email' => 'admin@eaa-s.jp', 'password' => 'admin123']);
return Redirect::to('/');
});
Route::get('restore/{id}', function ($id) {
$vehicles = Vehicle::withTrashed()->find($id);
$vehicles->inspection()->restore();
$vehicles->inspectordetails()->restore();
$vehicles->certificate()->restore();
$vehicles->restore();
});
Route::get('nopermission', function () {
return View::make('errors.stop')->with('title', 'Error Message');
});
Route::model('vehicles', 'Vehicle');
//Route::model('vehiclesinspection', 'VehicleInspection');
Route::model('users', 'User');
Route::model('certificates', 'Certificate');
Route::model('inspectordetails', 'InspectorDetails');
Route::resource('users', 'UserController');
Route::post('unlock', 'UserController@unlock');
Route::get('lock', 'UserController@lock');
Route::get('logout', 'UserController@logout');
Route::group(array('before' => 'guest'), function () {
Route::get('login', 'UserController@login');
Route::post('loginpost', 'UserController@loginpost');
Route::get('register', 'UserController@register');
Route::post('registerpost', 'UserController@registerpost');
Route::get('resetpass', 'UserController@resetpass');
示例4: getEmployeesCut
public static function getEmployeesCut($id)
{
$price = Vehicle::withTrashed()->where('id', '=', $id)->pluck('employee_percentage');
return $price;
}