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


PHP Car::all方法代码示例

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


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

示例1: run

 public function run()
 {
     $faker = Faker::create();
     $parking_lot = ParkingLot::all()->random();
     $car = Car::all()->random();
     $order = new Order();
     $order->parking_lot_id = $parking_lot->id;
     $order->car_id = $car->id;
     $order->stripe_customer_id = $faker->swiftBicNumber;
     $order->save();
     $parking_lot = ParkingLot::all()->random();
     $car = Car::all()->random();
     $order2 = new Order();
     $order2->parking_lot_id = $parking_lot->id;
     $order2->car_id = $car->id;
     $order2->stripe_customer_id = $faker->swiftBicNumber;
     $order2->save();
     $parking_lot = ParkingLot::all()->random();
     $car = Car::all()->random();
     $order3 = new Order();
     $order3->parking_lot_id = $parking_lot->id;
     $order3->car_id = $car->id;
     $order3->stripe_customer_id = $faker->swiftBicNumber;
     $order3->save();
 }
开发者ID:Park-It,项目名称:parkit.dev,代码行数:25,代码来源:OrdersTableSeeder.php

示例2: edit

 /**
  * Show the form for editing the specified booking.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $booking = Booking::find($id);
     $clients = Client::all();
     $cars = Car::all();
     return View::make('bookings.edit', compact('booking', 'cars', 'clients'));
 }
开发者ID:kenkode,项目名称:umash-1,代码行数:13,代码来源:BookingsController.php

示例3: getAll

 public function getAll()
 {
     $obj = new Car($this->db);
     echo json_encode($obj->all());
 }
开发者ID:parth1403,项目名称:CarTracker_PHP,代码行数:5,代码来源:CarsController.php

示例4: index

 /**
  * Display a listing of cars
  *
  * @return Response
  */
 public function index()
 {
     $cars = Car::all();
     return View::make('cars.index', compact('cars'));
 }
开发者ID:kenkode,项目名称:umash-1,代码行数:10,代码来源:CarsController.php

示例5: getUserById

});
/* CAR START */
$app->get("/user/:id", "getUserById");
function getUserById($id)
{
    $user = User::find($id);
    echo $user;
}
$app->get("/car/:id", "getCarById");
function getCarById($id)
{
    $car = Car::find($id);
    echo $car;
}
$app->get("/cars", function () {
    $cars = Car::all();
    echo $cars;
});
$app->delete("/cars/:id", "deleteCar");
function deleteCar($id)
{
    $car = Car::destroy($id);
    echo "done";
}
$app->post("/car", "createCar");
function createCar()
{
    $request = Slim\Slim::getInstance()->request();
    $car = json_decode($request->getBody());
    $car = Car::create(['users_idU' => 1, 'modelC' => $car->modelC, 'brandC' => $car->brandC, 'registrationC' => $car->registrationC]);
    echo $car;
开发者ID:abigoroth,项目名称:simphp-eloquent-backbonejs,代码行数:31,代码来源:index.php

示例6: Car

<?php

require 'Wheel.php';
require 'Engine.php';
require 'Car.php';
$car = new Car();
//$car->startAndStop();
//$car->rollAndDrift();
$car->all();
开发者ID:NideXTC,项目名称:CoursYNov,代码行数:9,代码来源:index.php


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