Hager
Hager
FFilament
Created by Hager on 7/14/2024 in #❓┊help
image
how can i import CSV file with images?
3 replies
FFilament
Created by Hager on 6/26/2024 in #❓┊help
i have this problem that the data didn't store in database and i get the table is empty when asserti
public function test_can_create_new_company()
{

$newData = Company::factory()->make();
$newData = $newData->toArray();

livewire(CompanyResource\Pages\CreateCompany::class)
->fillForm([
'name' => [
'ar' => $newData['name']['ar'],
'en' => $newData['name']['en'],
],
'description' => [
'ar' => $newData['description']['ar'],
'en' => $newData['description']['en'],
],
])
->call('create')
->assertHasNoFormErrors();

$this->assertDatabaseHas(Company::class, [
'name' => [
'ar' => $newData['name']['ar'],
'en' => $newData['name']['en'],
],
'description' => [
'ar' => $newData['description']['ar'],
'en' => $newData['description']['en'],
],

]);
}
public function test_can_create_new_company()
{

$newData = Company::factory()->make();
$newData = $newData->toArray();

livewire(CompanyResource\Pages\CreateCompany::class)
->fillForm([
'name' => [
'ar' => $newData['name']['ar'],
'en' => $newData['name']['en'],
],
'description' => [
'ar' => $newData['description']['ar'],
'en' => $newData['description']['en'],
],
])
->call('create')
->assertHasNoFormErrors();

$this->assertDatabaseHas(Company::class, [
'name' => [
'ar' => $newData['name']['ar'],
'en' => $newData['name']['en'],
],
'description' => [
'ar' => $newData['description']['ar'],
'en' => $newData['description']['en'],
],

]);
}
3 replies