Fügen Sie ausgewählt zu Dropdpown Item Laravel

@foreach ($categories as $category)
    <option value="{{ $category->id }}"{{ $category->id === $post->category_id ? ' selected' : '' }}>{{ $category->name }}</option>
@endforeach
Zany Zebra