April 2026 waren Wirtschaft Feedback
This commit is contained in:
parent
02f2a4c23e
commit
9ce711d6b2
167 changed files with 25278 additions and 8518 deletions
59
app/Http/Controllers/Admin/Inventory/LocationController.php
Normal file
59
app/Http/Controllers/Admin/Inventory/LocationController.php
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Inventory;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\Inventory\StoreLocationRequest;
|
||||
use App\Http\Requests\Inventory\UpdateLocationRequest;
|
||||
use App\Models\Location;
|
||||
|
||||
class LocationController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return view('admin.inventory.locations.index', [
|
||||
'values' => Location::query()->orderBy('name')->get(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('admin.inventory.locations.form', [
|
||||
'model' => new Location(['active' => true]),
|
||||
]);
|
||||
}
|
||||
|
||||
public function store(StoreLocationRequest $request)
|
||||
{
|
||||
Location::create($request->validated());
|
||||
|
||||
\Session::flash('alert-save', '1');
|
||||
|
||||
return redirect()->route('admin.inventory.locations.index');
|
||||
}
|
||||
|
||||
public function edit(Location $location)
|
||||
{
|
||||
return view('admin.inventory.locations.form', [
|
||||
'model' => $location,
|
||||
]);
|
||||
}
|
||||
|
||||
public function update(UpdateLocationRequest $request, Location $location)
|
||||
{
|
||||
$location->update($request->validated());
|
||||
|
||||
\Session::flash('alert-save', '1');
|
||||
|
||||
return redirect()->route('admin.inventory.locations.index');
|
||||
}
|
||||
|
||||
public function destroy(Location $location)
|
||||
{
|
||||
$location->delete();
|
||||
|
||||
\Session::flash('alert-success', __('Eintrag gelöscht'));
|
||||
|
||||
return redirect()->route('admin.inventory.locations.index');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue