/** * Run the database seeds. * * @return void */ public function run() { Post::create(['title' => 'Hello world', 'user_id' => 1, 'slug' => 'hello-world', 'content' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ducimus, vero, obcaecati, aut, error quam sapiente nemo saepe quibusdam sit excepturi nam quia corporis eligendi eos magni recusandae laborum minus inventore?', 'status' => 1]); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { Post::find($id)->delete(); return redirect()->route('admin.post.index')->with('success', 'Successfully deleted!'); }
public function show($slug) { return view('cms::front.cms.show', ['post' => Post::where('slug', $slug)->first()]); }