Created
March 15, 2018 16:25
-
-
Save iboved/8d90fe4aae6a67fc37f859c881ba3e00 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# =================================== | |
# Form Field Definitions | |
# =================================== | |
fields: | |
title: | |
label: Title | |
span: left | |
type: text | |
sluggable: | |
label: Slug | |
type: sluggable | |
relationName: slugs | |
preset: | |
field: title | |
type: slug | |
span: right | |
required: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace Acme\Demo\Models; | |
use Model; | |
use BusyRoomsCMS\Backend\Traits\BaseTrait; | |
/** | |
* Post Model | |
*/ | |
class Post extends Model | |
{ | |
use BaseTrait; | |
public $implement = ['@RainLab.Translate.Behaviors.TranslatableModel']; | |
public $translatable = [ | |
'title', | |
]; | |
/** | |
* @var array Guarded fields | |
*/ | |
protected $guarded = ['*']; | |
/** | |
* @var array Fillable fields | |
*/ | |
protected $fillable = []; | |
public $morphMany = [ | |
'slugs' => ['BusyRoomsCMS\Backend\Models\Slug', 'name' => 'sluggable', 'delete' => true], | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment