<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use DB;
use Session;
class shippingchargescontroller extends Controller
{
//
public function shipping_charges(){
$charges=DB::Table('shipping_charges')->get();
return view('admin.shipping_charges.list',array('charges'=>$charges));
}
public function add_shipping_charge(){
return view('admin.shipping_charges.add');
}
public function insert_shipping_charge(Request $request){
$data=array(
'range_from'=>$request['range_from'],
'range_to'=>$request['range_to'],
'amount'=>$request['amount'],
);
DB::Table('shipping_charges')->insert($data);
Session::flash('msg', 'Shipping Charge has been added');
return redirect('shipping_charges');
}
public function edit_shipping_charge($charge_id){
$charges=DB::Table('shipping_charges')->where('shipping_charge_id',$charge_id)->get();
return view('admin.shipping_charges.edit',array('charges'=>$charges));
}
public function update_shipping_charge(Request $request){
$data=array(
'range_from'=>$request['range_from'],
'range_to'=>$request['range_to'],
'amount'=>$request['amount'],
);
DB::Table('shipping_charges')->where('shipping_charge_id',$request['shipping_charge_id'])->update($data);
Session::flash('msg', 'Shipping Charge has been Updated');
return redirect('shipping_charges');
}
public function delete_shipping_charge($shipping_charge_id){
DB::Table('shipping_charges')->where('shipping_charge_id',$shipping_charge_id)->delete();
Session::flash('msg2', 'Shipping Charge has been Deleted');
return redirect('shipping_charges');
}
}
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]