bookinventory/app/Http/Controllers/LocationController.php

84 lines
1.7 KiB
PHP
Raw Normal View History

2020-12-21 07:09:34 +00:00
<?php
namespace App\Http\Controllers;
2020-12-26 10:46:23 +00:00
use App\Models\Location;
2020-12-21 07:09:34 +00:00
use Illuminate\Http\Request;
class LocationController extends Controller {
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index() {
2020-12-27 00:34:07 +00:00
return view('locations.index', [ 'locations' => Location::paginate(15) ]);
2020-12-21 07:09:34 +00:00
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create() {
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request) {
//
}
/**
* Display the specified resource.
*
* @param int $id
2020-12-26 10:46:23 +00:00
* @return mixed
2020-12-21 07:09:34 +00:00
*/
public function show($id) {
2020-12-26 10:46:23 +00:00
$location = Location::find($id);
if (!$location) {
abort(404);
}
2020-12-27 00:34:07 +00:00
return view('locations.show', [ 'location' => $location, 'rows' => $location->books()->paginate(15) ]);
2020-12-21 07:09:34 +00:00
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($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) {
//
}
}