Customers Add+Edit, API WP
This commit is contained in:
parent
dc63fa9fb2
commit
75a0f9a38a
120 changed files with 11894 additions and 6134 deletions
|
|
@ -8,8 +8,7 @@ namespace App\Http\Controllers;
|
|||
use App\Models\Shipping;
|
||||
use App\Models\ShippingCountry;
|
||||
use App\Models\ShippingPrice;
|
||||
use Input;
|
||||
use Illuminate\Http\Request;
|
||||
use Request;
|
||||
use Validator;
|
||||
|
||||
|
||||
|
|
@ -58,7 +57,7 @@ class ShippingController extends Controller
|
|||
public function store(Request $request)
|
||||
{
|
||||
$shipping = false;
|
||||
$data = Input::all();
|
||||
$data = Request::all();
|
||||
|
||||
if($data['action'] == 'shipping'){
|
||||
if ($data['id'] == "new") {
|
||||
|
|
@ -69,11 +68,11 @@ class ShippingController extends Controller
|
|||
$rules = array('name' => 'required');
|
||||
}
|
||||
$ret = ['value' => $shipping];
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
$validator = Validator::make(Request::all(), $rules);
|
||||
if ($validator->fails()) {
|
||||
return view('admin.shipping.edit', $ret)->withErrors($validator);
|
||||
}
|
||||
$data = Input::all();
|
||||
$data = Request::all();
|
||||
$shipping->name = $data['name'];
|
||||
$shipping->free = $data['free'];
|
||||
$shipping->active = isset($data['active']) ? true : false;
|
||||
|
|
@ -84,7 +83,7 @@ class ShippingController extends Controller
|
|||
$shipping = Shipping::findOrFail($data['shipping_id']);
|
||||
$rules = array('price' => 'required');
|
||||
$ret = ['value' => $shipping];
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
$validator = Validator::make(Request::all(), $rules);
|
||||
if ($validator->fails()) {
|
||||
return view('admin.shipping.edit', $ret)->withErrors($validator);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue