+++ /dev/null
-<?php
-
-
-namespace Cubist\Backpack;
-
-use Backpack\CRUD\CrudRouter;
-
-use Illuminate\Support\Facades\Route;
-
-class CubistCrudRouter extends CrudRouter
-{
- public function __construct($name, $controller, $options)
- {
- parent::__construct($name, $controller, $options);
-
- Route::post($this->name . '/bulk-publish', [
- 'as' => 'crud.' . $this->name . '.bulkPublish',
- 'uses' => $this->controller . '@bulkPublish',
- ]);
-
- Route::post($this->name . '/bulk-offline', [
- 'as' => 'crud.' . $this->name . '.bulkOffline',
- 'uses' => $this->controller . '@bulkOffline',
- ]);
-
- Route::post($this->name . '/bulk-translations-replace', [
- 'as' => 'crud.' . $this->name . '.bulkTranslationsReplace',
- 'uses' => $this->controller . '@bulkTranslationsReplace',
- ]);
-
- Route::match(['post'], $this->name . '/{id}/media', $this->controller . '@uploadMedia');
- Route::match(['delete'], $this->name . '/{id}/media/{mediaId}', $this->controller . '@deleteMedia');
- Route::match(['post'], $this->name . '/{id}/media/reorder', $this->controller . '@reorderMedia');
- }
-}
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Redirect;
+use Illuminate\Support\Facades\Route;
class CubistMagicController extends CubistCrudController
{
parent::__construct();
}
+ // Routes
+//Route::post($this->name . '/bulk-publish', [
+////'as' => 'crud.' . $this->name . '.bulkPublish',
+////'uses' => $this->controller . '@bulkPublish',
+////]);
+////
+////Route::post($this->name . '/bulk-offline', [
+////'as' => 'crud.' . $this->name . '.bulkOffline',
+////'uses' => $this->controller . '@bulkOffline',
+////]);
+////
+////Route::post($this->name . '/bulk-translations-replace', [
+////'as' => 'crud.' . $this->name . '.bulkTranslationsReplace',
+////'uses' => $this->controller . '@bulkTranslationsReplace',
+////]);
+///
+///
+
+ public function setupMediaRoutes($segment, $routeName, $controller)
+ {
+ Route::match(['post'], $segment . '/{id}/media', $controller . '@uploadMedia');
+ Route::match(['delete'], $segment . '/{id}/media/{mediaId}', $controller . '@deleteMedia');
+ Route::match(['post'], $segment . '/{id}/media/{mediaId}', $controller . '@reorderMedia');
+ }
+
public function _postSetModel()
{
}
$this->crud->addField($field->getDefinition(), $field->getCRUDForm());
- $this->crud->orderFields(['id','variant']);
+ $this->crud->orderFields(['id', 'variant']);
$this->_fields[$field->getAttribute('name')] = $field;
}
use Illuminate\Support\Facades\App;
-class Locale extends SelectFromArray
+class LLocale extends SelectFromArray
{
public function __construct($attributes)
{
namespace Cubist\Backpack\app\Magic\Models;
-use Backpack\CRUD\CrudTrait;
+use Backpack\CRUD\app\Models\Traits\CrudTrait;
use Cubist\Backpack\app\Magic\BunchOfFields;
use Cubist\Backpack\app\Magic\Controllers\CubistMagicController;
use Cubist\Backpack\app\Magic\EntityData;