Skip to content
Discussion options

You must be logged in to vote

Hey @ericjanofski

You need to

  1. Define Accessor:
use Illuminate\Database\Eloquent\Casts\Attribute;

public function imageThumb(): Attribute
{
  return Attribute::make(
    get: fn () => ("<img id='$this->id' src='https://picsum.photos/id/$this->id/50' /> $this->label"),
  );
}
  1. Use it:
    CRUD::set('reorder.label', 'imageThumb');

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ericjanofski
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants