This commit is contained in:
2024-11-25 15:17:41 +03:00
parent 1bc7662be0
commit 745707ee09
8 changed files with 81 additions and 39 deletions

View File

@ -98,4 +98,9 @@ class TagController extends AdminController
$this->redirect("/admin/tag/");
}
public function actionSettings(): void
{
echo "tag settings";
}
}

View File

@ -11,8 +11,6 @@ use Illuminate\Database\Eloquent\Model;
* @property int $entity_id
* @property string $slug
* @property int $status
* @method static where(int[] $array)
* @method static find($id)
*/
class Tag extends Model
{
@ -21,13 +19,14 @@ class Tag extends Model
protected $table = 'tag';
protected $fillable = ['label', 'entity', 'slug', 'status'];
protected $fillable = ['label', 'entity', 'entity_id', 'slug', 'status'];
public static function labels(): array
{
return [
'label' => 'Заголовок',
'entity' => 'Сущность',
'entity_id' => 'Идентификатор сущность',
'slug' => 'Slug',
'status' => 'Статус',
];

View File

@ -15,4 +15,7 @@ App::$collector->group(["prefix" => "admin"], function (CgRouteCollector $router
App::$collector->any("/edit/{id}", [\app\modules\tag\controllers\TagController::class, 'actionEdit']);
App::$collector->get('/delete/{id}', [\app\modules\tag\controllers\TagController::class, 'actionDelete']);
});
App::$collector->group(["prefix" => "settings"], function (CGRouteCollector $router){
App::$collector->get('/tag', [\app\modules\tag\controllers\TagController::class, 'actionSettings']);
});
});