You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
topnotch_website/app/Http/Controllers/PackingSlipController.php

39 lines
952 B
PHP

<?php
namespace App\Http\Controllers;
use App\Http\Requests\PackingSlipRequest;
use App\Models\Customer;
use App\Models\PackingSlip;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
class PackingSlipController extends Controller
{
public function index(): void {}
public function create(): void {}
public function store(PackingSlipRequest $request): RedirectResponse
{
PackingSlip::create($request->validated());
if ($request->get('from_customer')) {
return redirect()->route('customers.show', [
Customer::find($request->get('customer_id')),
'tab' => 'packing',
]);
}
return redirect()->back(); //todo: change to packing slips page
}
public function show($id): void {}
public function edit($id): void {}
public function update(Request $request, $id): void {}
public function destroy($id): void {}
}