@@ -7,12 +7,12 @@ |
||
7 | 7 | |
8 | 8 | class ShopLogoutController extends AuthenticatedSessionController |
9 | 9 | { |
10 | - /** |
|
11 | - * Destroy an authenticated session. |
|
12 | - * |
|
13 | - * @param \Illuminate\Http\Request $request |
|
14 | - * @return \Illuminate\Http\RedirectResponse |
|
15 | - */ |
|
10 | + /** |
|
11 | + * Destroy an authenticated session. |
|
12 | + * |
|
13 | + * @param \Illuminate\Http\Request $request |
|
14 | + * @return \Illuminate\Http\RedirectResponse |
|
15 | + */ |
|
16 | 16 | public function destroy(Request $request) |
17 | 17 | { |
18 | 18 | Auth::guard('web')->logout(); |
@@ -43,7 +43,7 @@ |
||
43 | 43 | 'email_verified_at' => 'datetime', |
44 | 44 | ]; |
45 | 45 | |
46 | - public function orders(){ |
|
47 | - return $this->hasMany(Order::class,'user_id'); |
|
46 | + public function orders() { |
|
47 | + return $this->hasMany(Order::class, 'user_id'); |
|
48 | 48 | } |
49 | 49 | } |
@@ -10,17 +10,17 @@ |
||
10 | 10 | { |
11 | 11 | use HasFactory; |
12 | 12 | |
13 | - public static function getStripeApiKey(){ |
|
13 | + public static function getStripeApiKey() { |
|
14 | 14 | $globalSetting = self::first(); |
15 | 15 | return $globalSetting->stripe_api_key; |
16 | 16 | } |
17 | 17 | |
18 | - public static function getStripeApiSecretKey(){ |
|
18 | + public static function getStripeApiSecretKey() { |
|
19 | 19 | $globalSetting = self::first(); |
20 | 20 | return $globalSetting->stripe_api_secret; |
21 | 21 | } |
22 | 22 | |
23 | - public static function getIban(){ |
|
23 | + public static function getIban() { |
|
24 | 24 | $globalSetting = self::first(); |
25 | 25 | return $globalSetting->iban; |
26 | 26 | } |
@@ -14,21 +14,21 @@ |
||
14 | 14 | { |
15 | 15 | use HasFactory; |
16 | 16 | |
17 | - protected $dates = ["created_at","updated_at"]; |
|
17 | + protected $dates = ["created_at", "updated_at"]; |
|
18 | 18 | |
19 | - public function status(){ |
|
20 | - return $this->belongsTo(OrderStatus::class,'status_id'); |
|
19 | + public function status() { |
|
20 | + return $this->belongsTo(OrderStatus::class, 'status_id'); |
|
21 | 21 | } |
22 | 22 | |
23 | - public function typePayment(){ |
|
24 | - return $this->belongsTo(TypePayment::class,'payment_type_id'); |
|
23 | + public function typePayment() { |
|
24 | + return $this->belongsTo(TypePayment::class, 'payment_type_id'); |
|
25 | 25 | } |
26 | 26 | |
27 | - public function user(){ |
|
28 | - return $this->belongsTo(User::class,'user_id'); |
|
27 | + public function user() { |
|
28 | + return $this->belongsTo(User::class, 'user_id'); |
|
29 | 29 | } |
30 | 30 | |
31 | - public function products(){ |
|
32 | - return $this->belongsToMany(ProductItem::class,'product_order','order_id','product_item_id')->withPivot('number_products'); |
|
31 | + public function products() { |
|
32 | + return $this->belongsToMany(ProductItem::class, 'product_order', 'order_id', 'product_item_id')->withPivot('number_products'); |
|
33 | 33 | } |
34 | 34 | } |
@@ -12,15 +12,15 @@ |
||
12 | 12 | { |
13 | 13 | use HasFactory; |
14 | 14 | protected $table = 'cart'; |
15 | - protected $dates = ["created_at","updated_at"]; |
|
15 | + protected $dates = ["created_at", "updated_at"]; |
|
16 | 16 | |
17 | 17 | |
18 | - public function user(){ |
|
19 | - return $this->belongsTo(User::class,'user_id'); |
|
18 | + public function user() { |
|
19 | + return $this->belongsTo(User::class, 'user_id'); |
|
20 | 20 | } |
21 | 21 | |
22 | - static function emptyCart(){ |
|
23 | - self::where('user_id',Auth::user()->id)->delete(); |
|
22 | + static function emptyCart() { |
|
23 | + self::where('user_id', Auth::user()->id)->delete(); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('product_order', function (Blueprint $table) { |
|
16 | + Schema::create('product_order', function(Blueprint $table) { |
|
17 | 17 | $table->id(); |
18 | 18 | $table->unsignedBigInteger('order_id'); |
19 | 19 | $table->unsignedBigInteger('product_item_id'); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::table('users', function (Blueprint $table) { |
|
16 | + Schema::table('users', function(Blueprint $table) { |
|
17 | 17 | $table->string('name')->nullable()->change(); |
18 | 18 | $table->string('first_name')->nullable(); |
19 | 19 | $table->string('last_name')->nullable(); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | public function boot() |
22 | 22 | { |
23 | 23 | |
24 | - Blade::directive('money', function ($amount){ |
|
24 | + Blade::directive('money', function($amount) { |
|
25 | 25 | #return $fmt->formatCurrency($amount,"EUR"); |
26 | 26 | /*return "<?= $fmt->formatCurrency($amount,'EUR'); ?>";*/ |
27 | 27 | return "<?= abs($amount) > 1000 ? '€ ' .number_format($amount, 0, ',', '.') : '€ ' . number_format($amount, 2, ',', '.') ?>"; |
@@ -35,12 +35,12 @@ discard block |
||
35 | 35 | $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); |
36 | 36 | $this->loadRoutesFrom(__DIR__.'/routes.php'); |
37 | 37 | |
38 | - if(Schema::hasTable('admin_settings')){ |
|
38 | + if (Schema::hasTable('admin_settings')) { |
|
39 | 39 | //inject global information into views |
40 | 40 | View::share('mongicommerce', AdminSetting::first()); |
41 | 41 | } |
42 | 42 | |
43 | - if(Schema::hasTable('categories')){ |
|
43 | + if (Schema::hasTable('categories')) { |
|
44 | 44 | //inject global information into views |
45 | 45 | View::share('categories', Template::getStructureCategories()); |
46 | 46 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'mongicommerce'); |
104 | 104 | |
105 | 105 | // Register the main class to use with the facade |
106 | - $this->app->singleton('mongicommerce', function () { |
|
106 | + $this->app->singleton('mongicommerce', function() { |
|
107 | 107 | return new Mongicommerce; |
108 | 108 | }); |
109 | 109 | } |
@@ -7,17 +7,17 @@ |
||
7 | 7 | |
8 | 8 | class ShopSingleProductController extends Controller |
9 | 9 | { |
10 | - public function page($id,$product_item_id = null){ |
|
11 | - $product = Product::find($id); |
|
12 | - if($product_item_id == null){ |
|
13 | - return redirect()->route('shop.single.product',[$product->id,$product->items->first()->id]); |
|
14 | - } |
|
10 | + public function page($id,$product_item_id = null){ |
|
11 | + $product = Product::find($id); |
|
12 | + if($product_item_id == null){ |
|
13 | + return redirect()->route('shop.single.product',[$product->id,$product->items->first()->id]); |
|
14 | + } |
|
15 | 15 | |
16 | - $details_fields = Template::getDetailsFields($product,$product_item_id); |
|
17 | - $configuration_fields = Template::getConfigurationFields($product_item_id); |
|
18 | - $btn_cart = Template::buttonCart($product_item_id); |
|
19 | - $price = Product::getPrice($product_item_id); |
|
20 | - $image = Product::getImage($product_item_id); |
|
21 | - return view('mongicommerce.pages.single-product',compact('product','details_fields','configuration_fields','btn_cart','price','image')); |
|
22 | - } |
|
16 | + $details_fields = Template::getDetailsFields($product,$product_item_id); |
|
17 | + $configuration_fields = Template::getConfigurationFields($product_item_id); |
|
18 | + $btn_cart = Template::buttonCart($product_item_id); |
|
19 | + $price = Product::getPrice($product_item_id); |
|
20 | + $image = Product::getImage($product_item_id); |
|
21 | + return view('mongicommerce.pages.single-product',compact('product','details_fields','configuration_fields','btn_cart','price','image')); |
|
22 | + } |
|
23 | 23 | } |
@@ -7,17 +7,17 @@ |
||
7 | 7 | |
8 | 8 | class ShopSingleProductController extends Controller |
9 | 9 | { |
10 | - public function page($id,$product_item_id = null){ |
|
10 | + public function page($id, $product_item_id = null) { |
|
11 | 11 | $product = Product::find($id); |
12 | - if($product_item_id == null){ |
|
13 | - return redirect()->route('shop.single.product',[$product->id,$product->items->first()->id]); |
|
12 | + if ($product_item_id == null) { |
|
13 | + return redirect()->route('shop.single.product', [$product->id, $product->items->first()->id]); |
|
14 | 14 | } |
15 | 15 | |
16 | - $details_fields = Template::getDetailsFields($product,$product_item_id); |
|
16 | + $details_fields = Template::getDetailsFields($product, $product_item_id); |
|
17 | 17 | $configuration_fields = Template::getConfigurationFields($product_item_id); |
18 | 18 | $btn_cart = Template::buttonCart($product_item_id); |
19 | 19 | $price = Product::getPrice($product_item_id); |
20 | 20 | $image = Product::getImage($product_item_id); |
21 | - return view('mongicommerce.pages.single-product',compact('product','details_fields','configuration_fields','btn_cart','price','image')); |
|
21 | + return view('mongicommerce.pages.single-product', compact('product', 'details_fields', 'configuration_fields', 'btn_cart', 'price', 'image')); |
|
22 | 22 | } |
23 | 23 | } |