当前位置: 首页>>代码示例>>PHP>>正文


PHP Vehicle::withTrashed方法代码示例

本文整理汇总了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');
 }
开发者ID:dbakiu,项目名称:dvc,代码行数:14,代码来源:InvoiceController.php

示例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);
 }
开发者ID:abhikalotra,项目名称:Samples1,代码行数:12,代码来源:controller.php

示例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');
开发者ID:x4rMa,项目名称:Vehicle-Inspection-System,代码行数:31,代码来源:routes.php

示例4: getEmployeesCut

 public static function getEmployeesCut($id)
 {
     $price = Vehicle::withTrashed()->where('id', '=', $id)->pluck('employee_percentage');
     return $price;
 }
开发者ID:dbakiu,项目名称:dvc,代码行数:5,代码来源:Vehicle.php


注:本文中的Vehicle::withTrashed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。