]> _ Git - pmi.git/commitdiff
wip #2810 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 3 Jun 2019 14:59:52 +0000 (16:59 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 3 Jun 2019 14:59:52 +0000 (16:59 +0200)
app/Http/Controllers/Admin/ProductTypeCrudController.php
app/Models/Category.php
app/Models/Product.php
app/Models/Producttype.php
app/Models/Specification.php
resources/views/vendor/backpack/base/inc/sidebar_content.blade.php
routes/backpack/custom.php

index 8c6e3816286700ea60825fc33984068ddb7ea8ed..5cde01cea7dfd5d11580f1ecbec491ddfa46f24a 100644 (file)
@@ -7,7 +7,7 @@ use Cubist\Backpack\app\Magic\Controllers\CubistMagicController;
 class ProductTypeCrudController extends CubistMagicController
 {
     protected $_modelNamespace = 'App\Models\ProductType';
-    protected $_routeURL = 'product type';
+    protected $_routeURL = 'producttype';
     protected $_singular = 'product type';
     protected $_plural = 'product types';
     protected $_clonable = true;
index 12b31f5e997bac41d0cea096c73a6ceb7945a4ac..372fe12c27660a5da2a673f7479156e15c5a4cca 100644 (file)
@@ -6,7 +6,7 @@ use Cubist\Backpack\app\Magic\Models\CubistMagicNestedModel;
 
 class Category extends CubistMagicNestedModel
 {
-    protected $table = 'categories';
+    protected $table = 'catalog_categories';
 
     protected $_options = ['name' => 'category',
         'plural' => 'categories'];
index 938ccb0d229f1450ed5bfcb625165696db4176e4..4661e4e442328b732a5e673182aa0174d579b838 100644 (file)
@@ -6,7 +6,7 @@ use Cubist\Backpack\app\Magic\Models\CubistMagicModel;
 
 class Product extends CubistMagicModel
 {
-    protected $table = 'products';
+    protected $table = 'catalog_products';
 
     protected $_options = ['name' => 'product',
         'plural' => 'products'];
@@ -27,6 +27,11 @@ class Product extends CubistMagicModel
             'unique' => true,
             'translatable' => false]);
 
+        $this->addField(['name' => 'product_type',
+            'label' => 'Type de produit',
+            'type' => 'SelectFromModel',
+            'model' => 'App\Models\ProductType']);
+
         $this->addField(['name' => 'slug',
             'type' => 'Slug',
             'label' => 'Slug',
index 9b2ed572d7c8fd79dfd723068e3d431309525a53..499a3c586a4adc0438110e37b7598e9f3a22922a 100644 (file)
@@ -1,13 +1,15 @@
 <?php
+
 namespace App\Models;
 
 use Cubist\Backpack\app\Magic\Models\CubistMagicModel;
 
 class ProductType extends CubistMagicModel
 {
-    protected $table = 'product_types';
+    protected $table = 'catalog_product_types';
 
     protected $_options = ['name' => 'product type',
+        'route' => 'producttype',
         'plural' => 'product types'];
 
     public function setFields()
index 7da59de12aee45369ea23177edb997228b341b9e..39be6565dfff97d57a7a3b8ac09cf61d748e8c21 100644 (file)
@@ -7,7 +7,7 @@ use Cubist\Backpack\app\Magic\Models\CubistMagicModel;
 
 class Specification extends CubistMagicModel
 {
-    protected $table = 'specifications';
+    protected $table = 'catalog_specifications';
 
     protected $_options = ['name' => 'specification',
         'plural' => 'specifications'];
index 880aec540e5c0b6eec7cbfa03ff6c70ab10e9450..5fde75676cbf478649fd444a4e6b1fdf0a18787f 100644 (file)
@@ -26,7 +26,7 @@
     <li class="header">Catalog edition</li>
     <li><a href='{{ backpack_url('product') }}'><i class='fa fa-book'></i> <span>Products</span></a></li>
     <li><a href='{{ backpack_url('producttype') }}'><i class='fa fa-wpforms'></i> <span>Product types</span></a></li>
-    <li><a href='{{ backpack_url('specifications') }}'><i class='fa fa-align-left'></i> <span>Specifications</span></a>
+    <li><a href='{{ backpack_url('specification') }}'><i class='fa fa-align-left'></i> <span>Specifications</span></a>
     </li>
     <li><a href='{{ backpack_url('category') }}'><i class='fa fa-folder-open'></i> <span>Categories</span></a></li>
 @endcan
index a3449837e022104f2984f41f4fac14117f0d7fd6..b9d58b57fcb9721cab256717f41ce638faa78ceb 100644 (file)
@@ -5,7 +5,7 @@ Route::group([
     'namespace'  => 'App\Http\Controllers\Admin',
 ], function () { // custom admin routes
     CRUD::resource('category', 'CategoryCrudController');
-CRUD::resource('product', 'ProductCrudController');
-CRUD::resource('product type', 'ProductTypeCrudController');
-CRUD::resource('specification', 'SpecificationCrudController');
+    CRUD::resource('product', 'ProductCrudController');
+    CRUD::resource('producttype', 'ProductTypeCrudController');
+    CRUD::resource('specification', 'SpecificationCrudController');
 }); // this should be the absolute last line of this file