LaravelPackages.net
Acme Inc.
Toggle sidebar
viralsbackpack/backpackexcel

Import excel has relationship

76
0
1.0
About viralsbackpack/backpackexcel

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

BackPackExcel

Latest Version on Packagist Total Downloads Build Status StyleCI

This is where your description should go. Take a look at contributing.md to see a to do list.

Description

This package support import data from excel with relationship

Installation

Via Composer

$ composer require viralsbackpack/backpackexcel

Run command:

php artisan vendor:publish --provider="ViralsLaravel\ImportRelationExcel\ImportRelationExcelServiceProvider"

php artisan migrate

php artisan storage:link

Setup

_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);

Usage:

_Watch guide video: IMAGE ALT TEXT HERE

Change log

Please see the changelog for more information on what has changed recently.

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits

License

license. Please see the license file for more information.

Star History Chart