@php $isEdit = isset($post); // dd($post); $route = $isEdit ? route('posts.update', $post->id) : route('posts.store'); @endphp