How to read Images from excel and store them in database using laravel?

I am using Maatwebsite\Excel\ExcelServiceProvider::class plugin ,I want to store images and product details through Excel sheet . How can I upload images .excel data ? please help me… ProductController.php public function excelupload() { if(Input::hasFile(‘import_file’)){ $path = Input::file(‘import_file’)->getRealPath(); $data = Excel::load($path, function($reader) { })->get(); if(!empty($data) && $data->count()){ foreach ($data as $key => $value) { dd($value); $insert[]…

Laravel OrWhere having two conditions is not so obvious

Why in Eloquent a simple query as this one is not working? $matches = DB::table(“matches”) ->where([“team_a”=> $request->tid, “match_tipo”=>3]) ->orWhere([“team_a”=> $request->tid, “match_tipo”=>3]) ->first(); According to with other examples here on Stackoverflow, I should use a query in Where like: $matches = DB::table(“matches”) ->where([“match_tipo”=>3]) ->where(function($query, $request) { $query->where(‘team_h’,$request->tid) ->orWhere(‘team_a’,$request->tid); }) ->first(); But I should pass a second…

Laravel with 2 Primary Keys – update “increment” method?

I am using this solution for 2 primary keys in Laravel: https://stackoverflow.com/a/37076437/225114 Can anyone tell me how to also override the Eloquent “increment” method to work with duplicate keys? Laravel Framework 5.8.35 I am including the ‘CompositePrimaryKey ‘ trait into models like… namespace App\Models; use Illuminate\Database\Eloquent\Model; use App\Models\Traits\CompositePrimaryKey; class Devices extends Model { public $table…

Undefined parameters adding a card with laravel-cartalyst

I’m using Laravel 5.8 and laravel-cartalyst to make the link with stripe. Doing this code, it’s working : $customer = $stripe->customers()->create([ ‘name’ => $caserne->billing_name, ’email’ => $caserne->billing_email, ]); $caserne->billing_id = $customer[‘id’]; But adding a stripe card to this user, I’ve got error : Received unknown parameters: number, exp_month, cvc, exp_year $card = $stripe->cards()->create($caserne->billing_id, [ ‘number’…