public function update(Request $request, Post $post)
{
$post->update($request->all());
if($request->has('published_by')){
$post->published_by = true;
$post->save();
}
else{
$post->published_by = false;
$post->save();
}
return redirect()->route('admin.post.index')->with('success', 'Post updated');