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

Revision

Revision 250 | Revision 262 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 250 Revision 257
Zeile 1... Zeile 1...
1
<?php
1
<?php
Zeile 2... Zeile 2...
2
 
2
 
Zeile 3... Zeile 3...
3
    namespace App\Http\Controllers\online_shop;
3
    namespace App\Http\Controllers\online_shop;
-
 
4
 
4
 
5
    use App\Http\Controllers\Controller;
5
    use App\Http\Controllers\Controller;
6
    use App\Http\Requests\StoreSupplierShippingRequest;
-
 
7
    use App\Models\Shipping;
6
    use App\Models\Shipping;
8
    use App\Models\ShippingGroup;
7
    use App\Models\ShippingGroup;
9
    use Illuminate\Http\Request;
8
    use Illuminate\Contracts\Foundation\Application;
10
    use Illuminate\Contracts\Foundation\Application;
Zeile 9... Zeile 11...
9
    use Illuminate\Contracts\View\Factory;
11
    use Illuminate\Contracts\View\Factory;
10
    use Illuminate\Contracts\View\View;
12
    use Illuminate\Contracts\View\View;
Zeile 11... Zeile 13...
11
 
13
 
12
    class ShippingController extends Controller
14
    class ShippingController extends Controller
13
    {
15
    {
14
 
16
 
15
        public function __construct()
17
        public function __construct()
16
	{
18
        {
17
            $inselversand = array(
19
            $inselversand = array(
18
                "keine Berücksichtigung",
20
                "keine Berücksichtigung",
19
                "kein Inselversand",
21
                "kein Inselversand",
20
                "nur Inselversand",
22
                "nur Inselversand",
21
	    );
23
            );
22
            \View::share( "inselversand", $inselversand );
24
            \View::share( "inselversand", $inselversand );
23
            $shippingGroups = ShippingGroup::all();
25
            $shippingGroups = ShippingGroup::all();
24
            $versandgruppen = array();
26
            $versandgruppen = array();
25
            foreach( $shippingGroups as $shippingGroup )
27
            foreach ( $shippingGroups as $shippingGroup )
-
 
28
            {
26
            {
29
                $versandgruppen[$shippingGroup->id] = $shippingGroup->name;
27
                $versandgruppen[$shippingGroup->id] = $shippingGroup->name;
30
            }
28
            }
31
            \View::share( "versandgruppen", $versandgruppen );
29
            \View::share( "versandgruppen", $versandgruppen );
32
        }
30
	}
33
 
31
        public function index(): Factory|View|Application
34
        public function index(): Factory|View|Application
Zeile -... Zeile 35...
-
 
35
        {
-
 
36
            $shipping = Shipping::with( "shipping_group" )->orderBy( "rank" )->get();
-
 
37
            return View( "online_shop.shippingList", [ "shipping" => $shipping ] );
-
 
38
        }
-
 
39
 
-
 
40
        /**
-
 
41
         * Show the form for creating a new resource.
-
 
42
         *
-
 
43
         * @return Application|Factory|View
-
 
44
         */
-
 
45
        public function create(): View|Factory|Application
-
 
46
        {
-
 
47
            //
-
 
48
            return view( "online_shop.shipping" );
-
 
49
        }
-
 
50
 
-
 
51
        /**
-
 
52
         * Store a newly created resource in storage.
-
 
53
         *
-
 
54
         * @param StoreSupplierShippingRequest $request
-
 
55
         * @return void
-
 
56
         */
-
 
57
        public function store( Request $request ): void
-
 
58
        {
-
 
59
            //
-
 
60
            $data = $request->validated();
-
 
61
            Shipping::create( $data );
-
 
62
        }
-
 
63
 
-
 
64
        public function show( Shipping $shipping ): void
-
 
65
        {
-
 
66
            echo $shipping->name;
-
 
67
        }
-
 
68
 
-
 
69
        /**
-
 
70
         * Show the form for editing the specified resource.
-
 
71
         *
-
 
72
         * @param Shipping $shipping
-
 
73
         * @return Application|Factory|View
-
 
74
         */
-
 
75
        public function edit( Shipping $shipping ): View|Factory|Application
-
 
76
        {
-
 
77
            //
-
 
78
            $shipping->load( 'shipping_group' );
-
 
79
            return view( "online_shop.shipping", [ "vk" => $shipping, ] );
-
 
80
        }
-
 
81
 
-
 
82
        /**
-
 
83
         * Update the specified resource in storage.
-
 
84
         *
-
 
85
         * @param Request $request
-
 
86
         * @param Shipping $shipping
-
 
87
         * @return void
-
 
88
         */
-
 
89
        public function update( Request $request, Shipping $shipping ): void
-
 
90
        {
-
 
91
            //
-
 
92
            $data = $request->validated();
-
 
93
            $shipping->update( $data );
-
 
94
        }
-
 
95
 
-
 
96
        /**
-
 
97
         * Remove the specified resource from storage.
-
 
98
         *
-
 
99
         * @param Shipping $shipping
-
 
100
         * @return void
-
 
101
         */
32
        {
102
        public function destroy( Shipping $shipping ): void