$this->user = Auth::User();
это текущий авторизованный пользователь.public function invoiceView($id, $invoiceId)
{
$pdf = PDF::loadView('pdf.invoice', ['data' => User::where('id', $id], ['invoice' => Invoice::where('id', $invoiceId)->first()]);
return $pdf->stream('invoice.pdf');
}
public function index()
{
$categories = Category::withCount('posts')->orderByDesc('posts_count')->get();
return view('blog.category-index', ['categories' => $categories]);
}
@if($category->posts_count === 0)
<a href="#" class="uk-icon-link" uk-icon="trash" onclick="deleteCategory({{ $category->id }}, '{{ $category->title }}');"></a>
<form action="{{ route('category.destroy', $category->id) }}" method="post" id="destroy-{{ $category->id }}">
@csrf
</form>
@endif