fadlyshafa

Untitled

Apr 30th, 2020
156
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. namespace App\Http\Controllers\Admin;
  4.  
  5. use App\Http\Controllers\Controller;
  6. use Illuminate\Http\Request;
  7.  
  8. use App\Models\About_us;
  9.  
  10. class About_us_controller extends Controller
  11. {
  12.     public function index(){
  13.         $title = 'Manage About Us';
  14.         $dt = About_us::first();
  15.  
  16.         return view('admin.about_us.index',compact('title','dt'));
  17.     }
  18.  
  19.     public function update(Request $request){
  20.         $data['keterangan'] = $request->keterangan;
  21.         $data['created_at'] = date('Y-m-d H:i:s');
  22.         $data['updated_at'] = date('Y-m-d H:i:s');
  23.  
  24.         \DB::table('about_us')->update($data);
  25.         \Session::flash('sukses','Data berhasil diupdate');
  26.         return redirect()->back();
  27.     }
  28. }
RAW Paste Data