Skip to content

Commit

Permalink
WIP test
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Sep 21, 2024
1 parent 7fbe661 commit d1ea11c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Laravel/workbench/app/Models/Book.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Book extends Model
use HasFactory;
use HasUlids;

protected $visible = ['name', 'author', 'isbn', 'publication_date'];
protected $visible = ['name', 'slug', 'author', 'isbn', 'publication_date'];
protected $fillable = ['name'];

public function author(): BelongsTo
Expand All @@ -73,8 +73,8 @@ public function author(): BelongsTo
}

// Virtual field
public function getTitleAttribute(): string
public function getSlugAttribute(): string
{
return Str::title($this->name);
return Str::slug($this->name);
}
}

0 comments on commit d1ea11c

Please sign in to comment.