Invalid argument supplied for foreach()
My Controller function
use App\Tag
public function index()
{
//
$tags = Tag::all();
return view('tags.index')->withTags('$tags');
}
Index view blade
@foreach ($tags as $tag)
<tr>
<th>{{ $tag->id }}</th>
<td>
<a href="{{route('tags.show', $tag->id)}}">{{ $tag- >name }}</a>
</td>
</tr>
@endforeach