This is where your description should go. Take a look at contributing.md to see a to do list.
Via Composer
$ composer require viralsbackpack/backpackimageupload
Run command:
php artisan vendor:publish --provider="ViralsBackpack\BackPackImageUpload\BackPackImageUploadServiceProvider"
php artisan migrate
Create the symbolic link, run command:
php artisan storage:link
Config package in config/backpackimageupload.php
.
Add trait ViralsBackpack\BackPackImageUpload\Traits\HasImages
to model has image, Eg:
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Backpack\CRUD\CrudTrait;
use ViralsBackpack\BackPackImageUpload\Traits\HasImages;// <------------------------------- this one
class Tag extends Model
{
use CrudTrait;
use HasImages; // <------------------------------- this one
/*
|--------------------------------------------------------------------------
| GLOBAL VARIABLES
|--------------------------------------------------------------------------
*/
protected $table = 'tags';
protected $fillable = ['name'];
}
Add field:
$this->crud->addField([
'name' => 'images',
'label' => 'Images',
'type' => 'virals_browse_image',
]);
Package support upload image and pick uploaded image in server
Function provide:
Initialize the model
$model = Test::find($id);
Get all Image for model
$model->images;
Create Image
$model->createImage($params);
Update Image
$model->updateImage($params);
Delete Image:(delete image file and record)
$model->updateImage($params);
$params: array($link1, $link2) or string url image
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.