コード例 #1
0
 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();
 }
コード例 #2
0
 /**
  * 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'));
 }
コード例 #3
0
 public function getAll()
 {
     $obj = new Car($this->db);
     echo json_encode($obj->all());
 }
コード例 #4
0
ファイル: CarsController.php プロジェクト: kenkode/umash-1
 /**
  * Display a listing of cars
  *
  * @return Response
  */
 public function index()
 {
     $cars = Car::all();
     return View::make('cars.index', compact('cars'));
 }
コード例 #5
0
});
/* 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;
コード例 #6
0
ファイル: index.php プロジェクト: NideXTC/CoursYNov
<?php

require 'Wheel.php';
require 'Engine.php';
require 'Car.php';
$car = new Car();
//$car->startAndStop();
//$car->rollAndDrift();
$car->all();