Last active
July 20, 2020 09:28
-
-
Save mkwsra/c395a598f1f92feb6f2185e81684be84 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use App\Models\Post; | |
use App\Traits\HasUuid; | |
use Illuminate\Http\Request; | |
use Illuminate\Http\Response; | |
class PostController extends Controller | |
{ | |
// ... | |
public function show(Post $post, Request $request) | |
{ | |
// Handle the redirection to the new slug. | |
if (HasUuid::adjustShowURLSlug($post, $request)) { | |
return redirect($post->show_link); | |
} | |
// ... | |
return view('frontend.posts.show', compact('post')); | |
} | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment