mgsmus Hocam value leri dolu çekiyor problem kısmen gitti ancak veritabanında uid adlı bir bileşen var ve random veri olarak oluşuyor. Excelden sütun olarak uid i sildim. Models'e Bulk.php yi ekledim. Alttakileri uyguladım.
public function import(Request $request)
{
$user = $request->user();
$currentCompany = $user->currentCompany();
$currentCompany->subscription('main')->recordFeatureUsage('customers');
Excel::import(new UsersImport,request()->file('file'));
return redirect()->route('customers', ['company_uid' => $currentCompany->uid])->with('success', 'Başarılı!');
}
return new Bulk([
'uid' => $currentCompany->uid,
'company_id' => $row['company_id'],
'display_name' => $row['display_name'],
'contact_name' => $row['contact_name'],
'email' => $row['email'],
'phone' => $row['phone'],
'website' => $row['website'],
'currency_id' => $row['currency_id'],
'vat_number' => $row['vat_number'],
'muvkodu' => $row['muvkodu'],
]);
Bulk.php
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Bulk extends Model
{
protected $table = 'customers';
protected $fillable = [
'uid', 'company_id', 'display_name', 'contact_name', 'email', 'phone', 'website', 'currency_id', 'vat_number', 'muvkodu'
];
}
Aldığım hata: https://flareapp.io/share/x7X8zlA7