If anyone has any issues with this, then please do say. However, this is the solution that I have some up with and it works.
MdbidsController.php
public function show($mdbid)
{
try {
$table = Mdbid::whereMdbid($mdbid)->firstOrFail()->table();
} catch ( ModelNotFoundException $e ) {
Notification::error("Sorry that MDBID doesn't exist.");
return Redirect::home();
}
switch ($table) {
case 1:
$artist = Artist::whereMdbid($mdbid)->firstOrFail();
return Redirect::to('artists/' . $artist->mdbid);
break;
case 2:
$album = Album::whereMdbid($mdbid)->firstOrFail();
return Redirect::to('albums/' . $album->mdbid);
break;
case 3:
$track = Track::whereMdbid($mdbid)->firstOrFail();
return Redirect::to('tracks/' . $track->mdbid);
break;
case 7:
$user = User::whereMdbid($mdbid)->firstOrFail();
return Redirect::to('users/' . $user->mdbid);
break;
case 8:
$tag = Tag::whereMdbid($mdbid)->firstOrFail();
return Redirect::to('tags/' . $tag->mdbid);
break;
}
}