--- /dev/null
+<?php
+
+namespace App\Http\Controllers\Admin;
+
+use Cubist\Backpack\app\Magic\Controllers\CubistMagicController;
+
+class PageCrudController extends CubistMagicController
+{
+ protected $_modelNamespace = 'App\Models\Page';
+ protected $_routeURL = 'page';
+ protected $_singular = 'page';
+ protected $_plural = 'pages';
+ protected $_clonable = true;
+ protected $_bulk = true;
+ protected $_oneInstance= false;
+}
protected $_plural = 'produits';
protected $_clonable = true;
protected $_bulk = true;
+ protected $_oneInstance= false;
}
protected $_plural = 'types de produit';
protected $_clonable = true;
protected $_bulk = true;
+ protected $_oneInstance= false;
}
--- /dev/null
+<?php
+
+namespace App\Http\Controllers\Admin;
+
+use Cubist\Backpack\app\Magic\Controllers\CubistMagicController;
+
+class SettingsCrudController extends CubistMagicController
+{
+ protected $_modelNamespace = 'App\Models\Settings';
+ protected $_routeURL = 'settings';
+ protected $_singular = 'paramètre';
+ protected $_plural = 'paramètres';
+ protected $_clonable = true;
+ protected $_bulk = true;
+ protected $_oneInstance= true;
+}
protected $_plural = 'spécifications';
protected $_clonable = true;
protected $_bulk = true;
+ protected $_oneInstance= false;
}
+++ /dev/null
-<?php
-
-namespace App\Models;
-
-use Cubist\Backpack\app\Magic\Models\CubistMagicNestedModel;
-
-class Category extends CubistMagicNestedModel
-{
- protected $table = 'catalog_categories';
-
- protected $_options = ['name' => 'category',
- 'singular' => 'catégorie',
- 'plural' => 'catégories',
- 'route' => 'catalog_category'];
-
- public function setFields()
- {
- parent::setFields();
-
- $this->addField(['name' => 'name',
- 'label' => 'Category name',
- 'type' => 'Text',
- 'column' => true]);
-
- $this->addField(['name' => 'slug',
- 'type' => 'Slug',
- 'label' => 'Slug',
- 'column' => true]
- );
- }
-}
]
);
- $this->addField(['name' => 'featured_on_home',
- 'label' => 'Mis en avant sur la page d\'accueil',
- 'type' => 'Checkbox',
- 'column' => false,
- 'default' => 1]);
-
$this->addField(['name' => 'specifications',
'label' => 'Spécifications',
'type' => 'SelectFromModel',
--- /dev/null
+<?php
+
+
+namespace App\Models;
+
+
+class Settings extends \Cubist\Backpack\app\Magic\Models\Settings
+{
+public function setFields()
+{
+ parent::setFields();
+
+}
+}
--- /dev/null
+<?php
+
+
+namespace App\SubForms;
+
+
+use Cubist\Backpack\app\Magic\SubForm;
+
+class HomeSolution extends SubForm
+{
+ public function init()
+ {
+ parent::init();
+ $this->addField(['name' => 'title',
+ 'label' => 'Titre',
+ 'type' => 'Text']);
+
+ $this->addField(['name' => 'image',
+ 'label' => 'Image',
+ 'type' => 'Images']);
+ $this->addField(['name' => 'page',
+ 'label' => 'Lien vers',
+ 'type' => 'SelectFromModel',
+ 'optionsmodel' => 'App\Models\Page']);
+ }
+}
--- /dev/null
+<?php
+
+
+namespace App\SubForms;
+
+
+use Cubist\Backpack\app\Magic\SubForm;
+
+class Logo extends SubForm
+{
+ public function init()
+ {
+ parent::init();
+
+ $this->addField(['name' => 'title',
+ 'label' => 'Nom / Titre',
+ 'type' => 'Text']);
+
+ $this->addField(['name' => 'url',
+ 'type' => 'URL',
+ 'label' => 'Lien vers le site']);
+
+ $this->addField(['name' => 'logo',
+ 'type' => 'Images',
+ 'label' => 'logo']);
+ }
+}
'type' => 'BunchOfFields',
'bunch' => 'App\SubForms\Intro',
'label' => __('Introduction'),
- 'tab' => 'Contenus',
+ 'tab' => 'Intro',
]);
}
public function init()
{
parent::init();
+
$this->addField([
'name' => 'slideshow',
- 'type' => 'BunchOfFields',
+ 'type' => 'BunchOfFieldsMultiple',
'bunch' => 'App\SubForms\Slide',
'label' => __('Slideshow'),
- 'tab' => 'Contenus',
+ 'tab' => 'Slideshow',
+ ]);
+
+ $this->addField([
+ 'name' => 'services_support',
+ 'type' => 'BunchOfFields',
+ 'bunch' => 'App\SubForms\Intro',
+ 'label' => __('Bloc « Services & Support »'),
+ 'tab' => 'Services & Support',
]);
+
+ $this->addField(['name' => 'products_capteurs',
+ 'type' => 'SelectFromModel',
+ 'optionsmodel' => 'App\Models\ProductType',
+ 'label' => 'Capteurs',
+ 'tab' => 'Produits',
+ 'multiple' => true]);
+
+ $this->addField(['name' => 'solutions',
+ 'type'=>'BunchOfFieldsMultiple',
+ 'bunch'=>'App\SubForms\HomeSolution',
+ 'label'=>'Solutions',
+ 'tab' => 'Solutions / Applications']);
+
+ $this->addField(['name' => 'products_systems',
+ 'type' => 'SelectFromModel',
+ 'optionsmodel' => 'App\Models\ProductType',
+ 'label' => 'Systèmes de mesure',
+ 'tab' => 'Produits',
+ 'multiple' => true]);
+
+ $this->addField(['name' => 'logos',
+ 'type' => 'BunchOfFieldsMultiple',
+ 'bunch' => 'App\SubForms\Logo',
+ 'label' => 'Logos',
+ 'tab' => 'Clients']);
}
}
</li>
@endcan
@can('backpack_settings')
- <li><a href='{{ backpack_url('setting') }}'><i class='fa fa-cog'></i> <span>Settings</span></a></li>
+ <li><a href='{{ backpack_url('settings') }}'><i class='fa fa-cog'></i> <span>Paramètres</span></a></li>
@endcan
@endcan
<li class="header">Édition du catalogue de produits</li>
</li>
</ul>
</li>
- <li class="header">Backpack administration</li>
- <li><a href='{{ backpack_url('template') }}'><i class='fa fa-file'></i> <span>Templates</span></a></li>
- <li><a href='{{ backpack_url('subform') }}'><i class='fa fa-wpforms'></i> <span>Sub Forms</span></a></li>
- <li><a href='{{ backpack_url('model') }}'><i class='fa fa-database'></i> <span>Models</span></a></li>
<li class="header">Maintenance</li>
<li><a href='{{ backpack_url('backup') }}'><i class='fa fa-hdd-o'></i> <span>Backups</span></a></li>
<li><a href='{{ backpack_url('log') }}'><i class='fa fa-terminal'></i> <span>Logs</span></a></li>
'middleware' => ['web', config('backpack.base.middleware_key', 'admin')],
'namespace' => 'App\Http\Controllers\Admin',
], function () { // custom admin routes
- CRUD::resource('catalog_category', 'CategoryCrudController')->with(function () {
- Route::match(['post'], 'catalog_category/{id}/media', 'CategoryCrudController@uploadMedia');
- Route::match(['delete'], 'catalog_category/{id}/media/{mediaId}', 'CategoryCrudController@deleteMedia');
- Route::match(['post'], 'catalog_category/{id}/media/reorder', 'CategoryCrudController@reorderMedia');
+ CRUD::resource('page', 'PageCrudController')->with(function () {
+ Route::match(['post'], 'page/{id}/media', 'PageCrudController@uploadMedia');
+ Route::match(['delete'], 'page/{id}/media/{mediaId}', 'PageCrudController@deleteMedia');
+ Route::match(['post'], 'page/{id}/media/reorder', 'PageCrudController@reorderMedia');
});
CRUD::resource('product', 'ProductCrudController')->with(function () {
Route::match(['post'], 'product/{id}/media', 'ProductCrudController@uploadMedia');
Route::match(['delete'], 'producttype/{id}/media/{mediaId}', 'ProductTypeCrudController@deleteMedia');
Route::match(['post'], 'producttype/{id}/media/reorder', 'ProductTypeCrudController@reorderMedia');
});
+ CRUD::resource('settings', 'SettingsCrudController')->with(function () {
+ Route::match(['post'], 'settings/{id}/media', 'SettingsCrudController@uploadMedia');
+ Route::match(['delete'], 'settings/{id}/media/{mediaId}', 'SettingsCrudController@deleteMedia');
+ Route::match(['post'], 'settings/{id}/media/reorder', 'SettingsCrudController@reorderMedia');
+ });
CRUD::resource('specification', 'SpecificationCrudController')->with(function () {
Route::match(['post'], 'specification/{id}/media', 'SpecificationCrudController@uploadMedia');
Route::match(['delete'], 'specification/{id}/media/{mediaId}', 'SpecificationCrudController@deleteMedia');
<?php
echo `composer update -v --no-progress --profile --prefer-dist`;
echo `composer dump-autoload`;
-echo `php artisan config:cache`;
-echo `php artisan view:clear`;
-echo `php artisan view:cache`;
+//echo `php artisan config:cache`;
+//echo `php artisan view:clear`;
+//echo `php artisan view:cache`;
#`php artisan vendor:publish --provider="CubistBackpackServiceProvider"`;
// Database migrations
//`php artisan vendor:publish --tag=migrations`;