tanvirofficials / copy-clone
A Laravel Nova Package for Copy or clone a resource Data.
Installs: 11 886
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 1
Forks: 2
Open Issues: 1
pkg:composer/tanvirofficials/copy-clone
Requires
- php: >=7.1.0
- laravel/nova: *
README
By →tanvirofficials
Install Copy-clone package to your nova project
$ composer require tanvirofficials/copy-clone
Usage
use Tanvirofficials\CopyClone\CopyClone;
CopyClone::make()
->withMeta([
'resource' => 'posts', // resource url
'model' => 'App\Post', // model path
'id' => $this->id, // id of record
'relations' => ['tags', 'comments'], // an array of any relations to load (nullable).
'except' => ['status'], // an array of fields to not replicate (nullable).
'override' => ['status' => 'published'] // an array of fields and values which will be set on the modal after Cloning(nullable).
]),
You can either place it on the bottom right or top right corner.
For the bottom right corner , place the code bellow all of your nova feild.
For the top right corner , place the code on the top of all of your nova feild.
You can customize the Copy clone button text→
CopyClone::make()
->withMeta([
.... include other metas .... ,
'button_text' => 'Custom Copy\Clone Button', // By deafult its copy\clone icon.
]),
You can customize your own dialogue box. By Default →
Customization of confirm dialogue box .
→Use title,body,confirm_button_text and cancle_button_text meta for customization
CopyClone::make()
->withMeta([
.... include other metas .... ,
'title' => 'Custom Title', // by default 'title' => 'Confirmation'
'body' => 'Custom Body', // by default 'body' => 'Are you sure ?'
'confirm_button_text' => 'Custom Confirm Button' , // by default 'confirm_button_text' => 'Copy\Clone'
'cancle_button_text' => 'Custom Cancle Button' // by default 'cancle_button_text' => 'Cancle'
]),
→This package only available in Resource Detail page.