Helper methods

Learn about Laravel Admin Panel helper functions.

After you have your thumbnails generated, you may want to display the thumbnails in your view or get the thumbnail URL. In order to do that you need to add Resizable traits to your model.

use LaravelAdminPanel\Traits\Resizable;

class Article extends Model
{
    use Resizable;
}

Then you can call the thumbnail function in your view or anywhere you want.

@foreach($articles as $article)
    <img src="{{ Admin::image($article->thumbnail('small')) }}" />
@endforeach

@foreach($articles as $article)
    <img src="{{ Admin::image($article->thumbnail('small', 'photo')) }}" />
@endforeach

What’s Next