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


PHP Vehicle::findOrFail方法代码示例

本文整理汇总了PHP中Vehicle::findOrFail方法的典型用法代码示例。如果您正苦于以下问题:PHP Vehicle::findOrFail方法的具体用法?PHP Vehicle::findOrFail怎么用?PHP Vehicle::findOrFail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Vehicle的用法示例。


在下文中一共展示了Vehicle::findOrFail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: saveinspectordetails

 public function saveinspectordetails($id)
 {
     $rules = [];
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->passes()) {
         $vehicle = Vehicle::findOrFail($id);
         $vehicle->inspectordetails()->update(Input::except('_token', '_method', 'medrep'));
         //Event::fire('vehicle.inspected', array($vehicle));
         return Redirect::to('vehiclesinspection')->with('success', 'Vehicle Roadworthiness Report Saved Successfully');
     } else {
         return Redirect::to('vehicle/' . $id . '/report')->withErrors($validator)->withInput();
     }
 }
开发者ID:x4rMa,项目名称:Vehicle-Inspection-System,代码行数:13,代码来源:VehicleInspectionController.php

示例2: download

 public function download($id, $action = null)
 {
     $vehicle = Vehicle::findOrFail($id);
     $html = "<center> " . "<img src=" . URL::asset('assets/images/logoo.png') . "></center>" . "<br>" . "<center style='font-size:20px'>EAST AFRICA AUTOMOBILE SERVICE Co.,LTD" . "<br>" . "TEL : 046-205-7611  Website : http://www.eaa-s.jp" . "<br>" . "FAX : 046-205-7610  Email : info@eaa-s.jp" . "<br>" . "<p style='font-size:30px'><i>Certificate of Appraisal</i></p></center>" . "<br><b>Certificate Number: " . $vehicle->certificate->certno . "</b>" . "<br>" . "<br>" . "Date of Issue: " . $vehicle->certificate->updated_at . "<br>" . "Date of Appraisal: " . $vehicle->inspectordetails->updated_at . "<br>" . "<br>" . "<br>" . "Client: " . $vehicle->user->fullname . "<br>" . "Email: " . $vehicle->user->email . "<br>" . "Phone Number: " . $vehicle->user->phone . "<br>" . "<br>" . "<br>" . "We hereby certify that the vehicle, for which details are given below," . "has the following value at the time of appraisal in Japan" . "<br>" . "<br>" . "Make: " . $vehicle->make . "<br>" . "Model: " . $vehicle->model . "<br>" . "Engine Capacity (cc rating): " . $vehicle->enginecc . "<br>" . "Year of First Registration: " . $vehicle->yor . "<br>" . "Chassis Number: " . $vehicle->chasis . "<br>" . "Engine Number: " . $vehicle->engineno . "<br>" . "Inspected Mileage (Odometer Reading): " . $vehicle->mileage . "<br>" . "Inspected Date: " . $vehicle->inspection->updated_at . "<br>" . "<br>" . "<br>" . "Remarks: " . $vehicle->inspection->comment . "<br>" . "<br>" . "<br>" . "This appraisal for the vehicle was made in accordance with, and on the basis of the provisions set forth by" . " EAST AFRICA AUTOMOBILE SERVICES" . "<br>" . "<img src=" . URL::asset('assets/images/place.png') . ">" . "<br>" . "<img src=" . URL::asset('assets/images/sign.png') . ">" . "<br>" . "____________________________________________________________________________________________________________________________________________________ " . "<br>" . "THIS CERTIFICATE IS VALID FOR A PERIOD OF THREE(3) MONTHS FROM THE DATE OF ISSUE" . "<br>";
     if ($action == 'view') {
         return PDF::load($html, 'A4', 'portrait')->show();
     } else {
         return PDF::load($html, 'A4', 'portrait')->download($vehicle->certificate->certno);
     }
 }
开发者ID:x4rMa,项目名称:Vehicle-Inspection-System,代码行数:10,代码来源:VehicleController.php


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