|
2 | 2 |
|
3 | 3 | namespace Webfactor\Laravel\Backpack\Documents\Models; |
4 | 4 |
|
5 | | -use Illuminate\Database\Eloquent\Model; |
6 | 5 | use Backpack\CRUD\CrudTrait; |
| 6 | +use Illuminate\Database\Eloquent\Model; |
7 | 7 |
|
| 8 | +/** |
| 9 | + * Webfactor\Laravel\Backpack\Documents\Models\Document |
| 10 | + * |
| 11 | + * @property int $id |
| 12 | + * @property string $title |
| 13 | + * @property string $body |
| 14 | + * @property string $type |
| 15 | + * @property \Carbon\Carbon|null $created_at |
| 16 | + * @property \Carbon\Carbon|null $updated_at |
| 17 | + * @property-read mixed $translated_type |
| 18 | + * @method static \Illuminate\Database\Eloquent\Builder|\Webfactor\Laravel\Backpack\Documents\Models\Document whereBody($value) |
| 19 | + * @method static \Illuminate\Database\Eloquent\Builder|\Webfactor\Laravel\Backpack\Documents\Models\Document whereCreatedAt($value) |
| 20 | + * @method static \Illuminate\Database\Eloquent\Builder|\Webfactor\Laravel\Backpack\Documents\Models\Document whereId($value) |
| 21 | + * @method static \Illuminate\Database\Eloquent\Builder|\Webfactor\Laravel\Backpack\Documents\Models\Document whereTitle($value) |
| 22 | + * @method static \Illuminate\Database\Eloquent\Builder|\Webfactor\Laravel\Backpack\Documents\Models\Document whereType($value) |
| 23 | + * @method static \Illuminate\Database\Eloquent\Builder|\Webfactor\Laravel\Backpack\Documents\Models\Document whereUpdatedAt($value) |
| 24 | + * @mixin \Eloquent |
| 25 | + */ |
8 | 26 | class Document extends Model |
9 | 27 | { |
10 | 28 | use CrudTrait; |
@@ -45,6 +63,11 @@ class Document extends Model |
45 | 63 | |-------------------------------------------------------------------------- |
46 | 64 | */ |
47 | 65 |
|
| 66 | + public function getTranslatedTypeAttribute() |
| 67 | + { |
| 68 | + return trans('webfactor::documents.types.'.$this->type); |
| 69 | + } |
| 70 | + |
48 | 71 | /* |
49 | 72 | |-------------------------------------------------------------------------- |
50 | 73 | | MUTATORS |
|
0 commit comments