@@ -9,8 +9,8 @@ |
||
| 9 | 9 | |
| 10 | 10 | class AdminProductsListController extends Controller |
| 11 | 11 | { |
| 12 | - public function page(){ |
|
| 12 | + public function page() { |
|
| 13 | 13 | $products = Product::all(); |
| 14 | - return view('mongicommerce::admin.pages.products.products_list',['products' => $products]); |
|
| 14 | + return view('mongicommerce::admin.pages.products.products_list', ['products' => $products]); |
|
| 15 | 15 | } |
| 16 | 16 | } |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | class SettingsSeeder extends Seeder |
| 13 | 13 | { |
| 14 | - public function run(){ |
|
| 14 | + public function run() { |
|
| 15 | 15 | $settings = new AdminSetting(); |
| 16 | 16 | $settings->shop_name = 'MongiCommerce'; |
| 17 | 17 | $settings->iban = 'DE79100110012626219557'; |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | class AdminConfigurationFieldController extends Controller |
| 14 | 14 | { |
| 15 | - public function setNewConfiguration(Request $r){ |
|
| 15 | + public function setNewConfiguration(Request $r) { |
|
| 16 | 16 | |
| 17 | 17 | $r->validate([ |
| 18 | 18 | 'name' => 'required', |
@@ -33,11 +33,11 @@ discard block |
||
| 33 | 33 | return response()->json(true); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - public function getConfigurationFields(Request $r){ |
|
| 36 | + public function getConfigurationFields(Request $r) { |
|
| 37 | 37 | $category_id = $r->get('category_id'); |
| 38 | - $configurationFields = ConfigurationField::where('category_id',$category_id)->get(); |
|
| 38 | + $configurationFields = ConfigurationField::where('category_id', $category_id)->get(); |
|
| 39 | 39 | $d = []; |
| 40 | - foreach ($configurationFields as $field){ |
|
| 40 | + foreach ($configurationFields as $field) { |
|
| 41 | 41 | $d[] = [ |
| 42 | 42 | 'name' => $field->name, |
| 43 | 43 | 'type' => $field->type, |
@@ -48,14 +48,14 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - public function generateConfigurationFieldHtml($field){ |
|
| 51 | + public function generateConfigurationFieldHtml($field) { |
|
| 52 | 52 | $type = $field->type; |
| 53 | 53 | $html = ''; |
| 54 | - if($type === 'textarea'){ |
|
| 54 | + if ($type === 'textarea') { |
|
| 55 | 55 | $html = ''; |
| 56 | - $html .= '<textarea data-configuration_id="'.$field->id .'" class="form-control mongiconfigurationfield"></textarea>'; |
|
| 57 | - }else{ |
|
| 58 | - $html .= '<input type="'.$type.'" data-configuration_id="'.$field->id .'" class="form-control mongiconfigurationfield">'; |
|
| 56 | + $html .= '<textarea data-configuration_id="'.$field->id.'" class="form-control mongiconfigurationfield"></textarea>'; |
|
| 57 | + } else { |
|
| 58 | + $html .= '<input type="'.$type.'" data-configuration_id="'.$field->id.'" class="form-control mongiconfigurationfield">'; |
|
| 59 | 59 | } |
| 60 | 60 | return $html; |
| 61 | 61 | } |
@@ -8,8 +8,8 @@ |
||
| 8 | 8 | |
| 9 | 9 | class AdminSettingsController |
| 10 | 10 | { |
| 11 | - public function page(){ |
|
| 11 | + public function page() { |
|
| 12 | 12 | $settings = AdminSetting::first(); |
| 13 | - return view('mongicommerce::admin.pages.settings',['settings' => $settings]); |
|
| 13 | + return view('mongicommerce::admin.pages.settings', ['settings' => $settings]); |
|
| 14 | 14 | } |
| 15 | 15 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('product_configuration_fields', function (Blueprint $table) { |
|
| 16 | + Schema::create('product_configuration_fields', function(Blueprint $table) { |
|
| 17 | 17 | $table->id(); |
| 18 | 18 | $table->unsignedBigInteger('product_item_id'); |
| 19 | 19 | $table->unsignedBigInteger('config_field_id'); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('admin_settings', function (Blueprint $table) { |
|
| 16 | + Schema::create('admin_settings', function(Blueprint $table) { |
|
| 17 | 17 | $table->id(); |
| 18 | 18 | $table->string('shop_name')->default('MongiCommerce'); |
| 19 | 19 | $table->string('iban')->default('DE79100110012626219557'); |
@@ -7,8 +7,8 @@ |
||
| 7 | 7 | |
| 8 | 8 | class AdminOrdersController |
| 9 | 9 | { |
| 10 | - public function page(){ |
|
| 10 | + public function page() { |
|
| 11 | 11 | $orders = Order::all(); |
| 12 | - return view('mongicommerce::admin.pages.orders.orders_list',['orders' => $orders]); |
|
| 12 | + return view('mongicommerce::admin.pages.orders.orders_list', ['orders' => $orders]); |
|
| 13 | 13 | } |
| 14 | 14 | } |
@@ -11,21 +11,21 @@ |
||
| 11 | 11 | { |
| 12 | 12 | use HasFactory; |
| 13 | 13 | |
| 14 | - protected $dates = ["created_at","updated_at"]; |
|
| 14 | + protected $dates = ["created_at", "updated_at"]; |
|
| 15 | 15 | |
| 16 | - public function status(){ |
|
| 17 | - return $this->belongsTo(OrderStatus::class,'status_id'); |
|
| 16 | + public function status() { |
|
| 17 | + return $this->belongsTo(OrderStatus::class, 'status_id'); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - public function typePayment(){ |
|
| 21 | - return $this->belongsTo(TypePayment::class,'type_payment_id'); |
|
| 20 | + public function typePayment() { |
|
| 21 | + return $this->belongsTo(TypePayment::class, 'type_payment_id'); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - public function user(){ |
|
| 25 | - return $this->belongsTo(User::class,'user_id'); |
|
| 24 | + public function user() { |
|
| 25 | + return $this->belongsTo(User::class, 'user_id'); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - public function products(){ |
|
| 29 | - return $this->belongsToMany(Product::class,'order_products','order_id','product_id')->withPivot('number_products'); |
|
| 28 | + public function products() { |
|
| 29 | + return $this->belongsToMany(Product::class, 'order_products', 'order_id', 'product_id')->withPivot('number_products'); |
|
| 30 | 30 | } |
| 31 | 31 | } |
@@ -29,11 +29,11 @@ |
||
| 29 | 29 | return $this->children_rec()->with('children'); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - public function configuration_fields(){ |
|
| 32 | + public function configuration_fields() { |
|
| 33 | 33 | return $this->hasMany(ConfigurationField::class); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - public function products(){ |
|
| 36 | + public function products() { |
|
| 37 | 37 | return $this->hasMany(Product::class); |
| 38 | 38 | } |
| 39 | 39 | |