viralsbackpack/backpackexcel is a Laravel package for import excel has relationship.
It currently has 0 GitHub stars and 76 downloads on Packagist (latest version 1.0).
Install it with composer require viralsbackpack/backpackexcel.
Discover more Laravel packages by viralsbackpack
or browse all Laravel packages to compare alternatives.
Last updated
This is where your description should go. Take a look at contributing.md to see a to do list.
This package support import data from excel with relationship
Via Composer
$ composer require viralsbackpack/backpackexcel
Run command:
php artisan vendor:publish --provider="ViralsLaravel\ImportRelationExcel\ImportRelationExcelServiceProvider"
php artisan migrate
php artisan storage:link
_Add trait ViralsLaravel\ImportRelationExcel\Traits\ViralsRelationshipMethod to model class, Eg:
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Backpack\CRUD\CrudTrait;
use ViralsLaravel\ImportRelationExcel\Traits\ViralsRelationshipMethod;// <------------------------------- this one
class Tag extends Model
{
use CrudTrait;
use ViralsRelationshipMethod; // <------------------------------- this one
/*
|--------------------------------------------------------------------------
| GLOBAL VARIABLES
|--------------------------------------------------------------------------
*/
protected $table = 'tags';
protected $fillable = ['name'];
}
_Add attribute $requestExcel to model class if you want validate data import
<?php
use App\Http\Requests\TagRequest;
class Tag extends Model
{
public $requestExcel = TagRequest::class;
}
_Add sidebar manager log import excel
<li><a href="{{ route('excel-fields.index') }}"><i class="fa fa-files-o"></i> <span>Virals Excels</span></a></li>
_In store method in controller, you call method import excel
$ip = new ViralsLaravel\ImportRelationExcel\HandlExcel\Import();
$ip->processImport($request->file);
Please see the changelog for more information on what has changed recently.
Please see contributing.md for details and a todolist.
If you discover any security related issues, please email author email instead of using the issue tracker.
license. Please see the license file for more information.