Exemplo n.º 1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function getShow($id)
 {
     $po = po::find(str_replace('-', '/', $id));
     return view('admin.transaction.po-show')->with('po', $po);
 }
Exemplo n.º 2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $po = po::find(str_replace('-', '/', $id));
     if ($po->detail->count()) {
         return redirect()->back()->withErrors(['Data tidak dapat di hapus']);
     }
     //$po->delete();
     return redirect('/admin/po')->withErrors(['Data sudah terhapus']);
 }