Answer the question
In order to leave comments, you need to log in
Can't use thumbnail() function. Why?
Here is the controller:
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Foundation\Validation\ValidatesRequests;
use TCG\Voyager\Traits\Resizable;
use App\Blog;
use DB;
class BlogController extends Controller
{
use ValidatesRequests;
use Resizable;
public function index()
{
$posts = DB::table('posts')->orderBy('created_at', 'desc')->paginate(5);
return view('blog', compact('posts'));
}
}
@foreach( $posts as $post )
<img src="{{ Voyager::image($post->thumbnail('small')) }}" alt="">
@endforeach
\vendor\tcg\voyager\src\Traits\Resizable.php
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question