Subversion-Projekte lars-tiefland.webanos.marine-sales.de

Revision

Revision 246 | Revision 248 | Zur aktuellen Revision | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
224 lars 1
<?php
2
 
226 lars 3
    namespace App\Http\Controllers\bestellwesen;
224 lars 4
 
5
    use App\Http\Controllers\Controller;
226 lars 6
    use App\Http\Requests\StoreSupplierShippingRequest;
7
    use App\Http\Requests\UpdateSupplierShippingRequest;
8
    use App\Models\Supplier;
9
    use App\Models\SupplierShipping;
10
    use Illuminate\Contracts\Foundation\Application;
11
    use Illuminate\Contracts\View\Factory;
12
    use Illuminate\Contracts\View\View;
247 lars 13
    use Illuminate\Http\Response;
224 lars 14
 
226 lars 15
    class SupplierShippingController extends Controller
224 lars 16
    {
226 lars 17
        /**
18
         * Display a listing of the resource.
19
         *
236 lars 20
         * @param Supplier $supplier
226 lars 21
         * @return Application|Factory|View
22
         */
23
        public function index( Supplier $supplier ): View|Factory|Application
24
        {
25
            //
26
            $vKosten = SupplierShipping::where( "supplier_id", $supplier->id )->get();
229 lars 27
            return view( "online_shop.shipping_include", [ "shipping" => $vKosten, "supplier" => $supplier, ] );
226 lars 28
        }
224 lars 29
 
226 lars 30
        /**
31
         * Show the form for creating a new resource.
32
         *
236 lars 33
         * @param Supplier $supplier
34
         * @return Application|Factory|View
226 lars 35
         */
236 lars 36
        public function create( Supplier $supplier ): View|Factory|Application
226 lars 37
        {
38
            //
236 lars 39
            return view( "online_shop.shipping", [ "supplier" => $supplier ] );
226 lars 40
        }
224 lars 41
 
226 lars 42
        /**
43
         * Store a newly created resource in storage.
44
         *
247 lars 45
         * @param StoreSupplierShippingRequest $request
46
         * @param Supplier $supplier
47
         * @return void
226 lars 48
         */
247 lars 49
        public function store( StoreSupplierShippingRequest $request, Supplier $supplier ): void
226 lars 50
        {
51
            //
247 lars 52
            $data = $request->validated();
53
            SupplierShipping::create( $data );
226 lars 54
        }
224 lars 55
 
226 lars 56
        /**
246 lars 57
         * Show the form for editing the specified resource.
226 lars 58
         *
242 lars 59
         * @param Supplier $supplier
60
         * @param SupplierShipping $shipping
61
         * @return Application|Factory|View
226 lars 62
         */
246 lars 63
        public function edit( Supplier $supplier, SupplierShipping $shipping ): View|Factory|Application
226 lars 64
        {
65
            //
242 lars 66
            return view( "online_shop.shipping", [ "supplier" => $supplier, "vk" => $shipping ] );
226 lars 67
        }
224 lars 68
 
226 lars 69
        /**
70
         * Update the specified resource in storage.
71
         *
247 lars 72
         * @param UpdateSupplierShippingRequest $request
73
         * @param Supplier $supplier
74
         * @param SupplierShipping $supplierShipping
75
         * @return void
226 lars 76
         */
247 lars 77
        public function update( UpdateSupplierShippingRequest $request, Supplier $supplier, SupplierShipping $supplierShipping ): void
226 lars 78
        {
79
            //
247 lars 80
            $data = $request->validated();
81
            $supplierShipping->update( $data );
226 lars 82
        }
224 lars 83
 
226 lars 84
        /**
85
         * Remove the specified resource from storage.
86
         *
247 lars 87
         * @param Supplier $supplier
88
         * @param SupplierShipping $supplierShipping
89
         * @return void
226 lars 90
         */
247 lars 91
        public function destroy( Supplier $supplier, SupplierShipping $supplierShipping ): void
226 lars 92
        {
93
            //
247 lars 94
            $supplierShipping->delete();
226 lars 95
        }
224 lars 96
    }