PHP code example of yemenopensource / filament-excel

1. Go to this page and download the library: Download yemenopensource/filament-excel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

yemenopensource / filament-excel example snippets


php artisan make:import ContentsImport --model=Content

// app\Filament\Resources\ContentResource\Pages\ListContents.php

use YOS\FilamentExcel\Actions\Import;

protected function getHeaderActions(): array
{
    return [
        // ...  other actions like 'CreateAction'
        Import::make()
            ->import(ContentsImport::class)
            ->type(\Maatwebsite\Excel\Excel::XLSX)
            ->label('Import from excel')
            ->hint('Upload xlsx type')
            ->icon(HeroIcons::C_ARROW_UP)
            ->color('success'),
    ];
}
bash
php artisan vendor:publish --provider="YOS\FilamentExcel\ServiceProvider" --tag="config"
bash
php artisan vendor:publish --provider="YOS\FilamentExcel\ServiceProvider" --tag="config"