Merge branch 'master' of https://github.com/sebathefox/skolehjem-webapp
Conflicts: skolehjem/resources/views/app/root/index.blade.php
This commit is contained in:
@@ -1,100 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
|
||||
use App\Booking;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
|
||||
class BookingController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
$booking = Booking::query()->paginate($request->input("limit", 20));
|
||||
|
||||
return Response::detect("bookings.index", [ "bookings" => $booking]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return Response::detect("bookings.create");
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$requestBooking = $request->validate([
|
||||
"name_first" => "required|max:255",
|
||||
"name_last" => "required|max:255",
|
||||
"phone" => "required|unique:users",
|
||||
"machine_choice" => "required|max:255",
|
||||
]);
|
||||
|
||||
$booking = new Booking($requestBooking);
|
||||
$booking->save();
|
||||
|
||||
return Response::detect("bookings.store");
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return Response::detect("bookings.show", [ "bookings" => $id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
return Response::detect("bookings.show", [ "bookings" => $id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ class WashingReservationController extends Controller
|
||||
{
|
||||
$reservations = WashingReservation::query()->paginate($request->query("page", 1));
|
||||
|
||||
return Response::detect("washing-reservation.index");
|
||||
return Response::detect("washing-reservations.index", [ "reservations" => $reservations]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -29,7 +29,7 @@ class WashingReservationController extends Controller
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return Response::detect("washing-reservation.create");
|
||||
return Response::detect("washing-reservations.create");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -47,7 +47,7 @@ class WashingReservationController extends Controller
|
||||
$machineReservation = new WashingReservation($data);
|
||||
$machineReservation->save();
|
||||
|
||||
return Response::detect("washing-reservation.store");
|
||||
return Response::detect("washing-reservations.store");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,7 +60,7 @@ class WashingReservationController extends Controller
|
||||
{
|
||||
$machineReservation = WashingReservation::find($id);
|
||||
|
||||
return Response::detect("washing-reservation.show", [
|
||||
return Response::detect("washing-reservations.show", [
|
||||
"machineReservation" => $machineReservation
|
||||
]);
|
||||
}
|
||||
@@ -73,7 +73,7 @@ class WashingReservationController extends Controller
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
return Response::detect("washing-reservation.edit");
|
||||
return Response::detect("washing-reservations.edit");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,7 +95,7 @@ class WashingReservationController extends Controller
|
||||
|
||||
$machineReservation->save();
|
||||
|
||||
return Response::detect("washing-reservation.edit", [
|
||||
return Response::detect("washing-reservations.edit", [
|
||||
"washingReservation" => $machineReservation
|
||||
]);
|
||||
}
|
||||
@@ -111,6 +111,6 @@ class WashingReservationController extends Controller
|
||||
$machineReservation = WashingReservation::find($id);
|
||||
$machineReservation->delete();
|
||||
|
||||
return Response::detect("washing-reservation.delete");
|
||||
return Response::detect("washing-reservations.delete");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user