Skip to content

Commit

Permalink
Merge pull request #21 from SpekBin/master
Browse files Browse the repository at this point in the history
Minor tidy up and style improvements
  • Loading branch information
anaseqal committed Aug 17, 2020
2 parents 0e1af23 + fd734f9 commit f669a8e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 30 deletions.
42 changes: 19 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Import data to resources.

![screenshot](https://i.imgur.com/szKmLGf.gif)
![Screenshot](https://i.imgur.com/szKmLGf.gif)

## Installation

Expand All @@ -12,19 +12,20 @@ You can install the package in to a Laravel app that uses [Nova](https://nova.la
composer require anaseqal/nova-import
```

Register the tool in `NovaServiceProvider`:
Register the tool in your `app/Providers/NovaServiceProvider.php`:

```php
use Anaseqal\NovaImport\NovaImport;
...

// ...

public function tools()
{
return [
new NovaImport,
...
];
}
{
return [
new NovaImport,
// ...
];
}

```

Expand Down Expand Up @@ -63,15 +64,15 @@ class ImportUsers extends Action
* @var bool
*/
public $onlyOnIndex = true;

/**
* Get the displayable name of the action.
*
* @return string
*/
public function name() {
return __('Import Users');
}
* Get the displayable name of the action.
*
* @return string
*/
public function name() {
return __('Import Users');
}

/**
* @return string
Expand All @@ -90,6 +91,7 @@ class ImportUsers extends Action
public function handle(ActionFields $fields)
{
Excel::import(new UsersImport, $fields->file);

return Action::message('It worked!');
}

Expand All @@ -106,7 +108,6 @@ class ImportUsers extends Action
];
}
}

```

3. Register the action into your resource:
Expand All @@ -125,16 +126,11 @@ public function actions(Request $request)

```



Action Name must use the Format of `Import{ResourceName}`, for example `ImportUsers` or `ImportCountries`.

Please note that it extends `Anaseqal\NovaImport\Actions\Action` not normal Nova Actions because it doesn't applies on models!



## License

The MIT License (MIT). Please see [License File](LICENSE) for more information.


3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "anaseqal/nova-import",
"description": "A Laravel Nova tool.",
"description": "A Laravel Nova import tool.",
"keywords": [
"laravel",
"import",
"nova"
],
"license": "MIT",
Expand Down
2 changes: 0 additions & 2 deletions src/NovaImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ public function boot()
Nova::script('nova-import', __DIR__.'/../dist/js/tool.js');
Nova::style('nova-import', __DIR__.'/../dist/css/tool.css');
}


}
4 changes: 0 additions & 4 deletions src/ToolServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ class ToolServiceProvider extends ServiceProvider
*/
public function boot()
{


$this->app->booted(function () {

});
Expand All @@ -26,8 +24,6 @@ public function boot()
});
}



/**
* Register any application services.
*
Expand Down

0 comments on commit f669a8e

Please sign in to comment.