Closed altynbek07 closed 3 years ago
This method allow merge translatable property from extend class. It works like mergeCasts or mergeFillable methods. Example:
<?php namespace App\Models; use Rinvex\Categories\Models\Category as BaseCategory; class Category extends BaseCategory { /** * Create a new Eloquent model instance. * * @param array $attributes */ public function __construct(array $attributes = []) { parent::__construct($attributes); $this->mergeFillable([ 'meta_title', 'meta_description', 'is_active', 'is_menu', ]); $this->mergeCasts([ 'is_active' => 'boolean', 'is_menu' => 'boolean', ]); $this->mergeTranslatable([ 'meta_title', 'meta_description', ]); } }
Code Climate has analyzed commit cb5a4bcc and detected 0 issues on this pull request.
View more on Code Climate.
Thank you @altynbek07, that's a good one. Merged!
This method allow merge translatable property from extend class. It works like mergeCasts or mergeFillable methods. Example: