/*route.php*/
<?php
$router->bind('songs', function($slug)
{
return App\Song::whereSlug($slug)->first();
});
$router->resource('songs','SongsController');
Route::group(['middleware' => ['web']], function () {
});
?>
Getting undefined errors variable in blade.php
you need to pass the variable to your view create.balde.php that you are using their. here you actually return the array object.
use like this.
$song = App\Song::whereSlug($slug)->first();
return view('songs.create', compact('song'));
This error comes when you do not passed any variable and directly used in blade view file.