Skip to content

Commit

Permalink
fixed bug for all models
Browse files Browse the repository at this point in the history
  • Loading branch information
A1Gard committed Feb 4, 2024
1 parent 71d4738 commit fd32164
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 6 deletions.
21 changes: 17 additions & 4 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Models/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Category extends Model
{
use SoftDeletes,HasTranslations;

public $translatable = ['name','description'];
public function posts()
{
return $this->belongsToMany(Post::class);
Expand Down
1 change: 1 addition & 0 deletions src/Models/Clip.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class Clip extends Model
//
use SoftDeletes, Taggable, HasTranslations;

public $translatable = ['title','body'];

public function getRouteKeyName()
{
Expand Down
1 change: 1 addition & 0 deletions src/Models/Gallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class Gallery extends Model implements HasMedia
use InteractsWithMedia,HasTranslations;


public $translatable = ['title'];
public function images()
{
return $this->hasMany(Image::class, 'gallery_id', 'id')->orderBy('sort')->orderByDesc('id');
Expand Down
3 changes: 1 addition & 2 deletions src/Models/Poll.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Spatie\Translatable\HasTranslations;

/**
* App\Poll
Expand Down Expand Up @@ -39,7 +38,7 @@
*/
class Poll extends Model
{
use SoftDeletes, HasTranslations;
use SoftDeletes;

//
protected $guarded = [];
Expand Down
1 change: 1 addition & 0 deletions src/Models/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class Post extends Model implements HasMedia
{
use SoftDeletes, InteractsWithMedia, Taggable, HasTrixRichText, Searchable,HasTranslations;

public $translatable = ['title','sub_title','body'];

public function categories()
{
Expand Down
2 changes: 2 additions & 0 deletions src/Models/Slider.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class Slider extends Model
{
//

public $translatable = ['body'];

use HasTranslations;
public function imgUrl()
{
Expand Down

0 comments on commit fd32164

Please sign in to comment.