I'm struggling a couple of hours to fix this error but no luck please I need help about this error always says: (Array to string conversion)
Code:
<?php
namespace App\Http\Controllers;
use Validator;
use Illuminate\Http\Request;
use App\Http\Requests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Hash, Auth, URL, Route, Cart, View, Paypal;
use App\Product, App\ProductBenefit, App\Country, App\Currency, App\User, App\City;
class HomeController extends BaseController {
public function postCheckoutStepPayment(Request $request){
if(!is_null($request->input('ship_to_diff_address'))){
$validate = Validator::make($request->all(), User::$rules);
if($validate->fails()) { //<- problem this part
return 'failed';
}
}
}
}
User.php
public static $rules = array(
'diff_firstname' => 'required',
'diff_lastname' => 'required',
'diff_phone' => 'required',
'diff_countries' => 'required',
'diff_city' => 'required',
'diff_state' => 'required',
'diff_address' => 'required',
);