/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { // $post = new post(); $post->group_id = $request->input('group_id'); $post->author_id = Auth::user()->id; $post->title = $request->input('title'); $post->content = $request->input('content'); $post->photo = '/img/garen.jpg'; $post->save(); return Redirect::back(); }
/** * Store a newly created resource in storage. * * @return Response */ public function store() { $post = new post(); $post->idpengguna = Auth::user()->id; $post->judul = Input::get('judul'); $post->tag = Input::get('tag'); $post->isi = Input::get('isi'); $post->slug = str_slug(Input::get('judul')); if (Input::hasFile('sampul')) { $sampul = date("YmdHis") . uniqid() . "." . Input::file('sampul')->getClientOriginalExtension(); Input::file('sampul')->move(storage_path(), $sampul); $post->sampul = $sampul; } $post->save(); return redirect(url('artikel')); }
public function saveartikel(Request $request) { $post = new post(); $post->author = Input::get('author'); $post->judul = Input::get('judul'); $post->isi = Input::get('message'); $post->slug = str_slug(Input::get('judul')); if (Input::hasFile('gambar')) { $sampul = date("YmdHis"); uniqid() . "." . Input::file('gambar')->getClientOriginalExtension(); Input::file('gambar')->move(storage_path(), $sampul); $post->sampul = $sampul; } $post->save(); return redirect(url('artikel/openssl_pkey_get_details(key)')); }