Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/henrywhitaker3/laravel-actions
A simple Laravel actions package.
https://github.com/henrywhitaker3/laravel-actions
Last synced: about 2 months ago
JSON representation
A simple Laravel actions package.
- Host: GitHub
- URL: https://github.com/henrywhitaker3/laravel-actions
- Owner: henrywhitaker3
- License: mit
- Created: 2021-02-04T09:52:29.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-06T09:51:32.000Z (almost 4 years ago)
- Last Synced: 2024-10-31T11:05:02.332Z (2 months ago)
- Language: PHP
- Homepage:
- Size: 41 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Laravel Actions
[![Latest Version on Packagist][icon-version]][link-packagist]
![Tests status][icon-tests]
[![StyleCI][icon-styleci]][link-styleci]A simple Laravel actions package.
## Installation
```bash
composer require henrywhitaker3/laravelactions
```## Usage
To create a new action, run:
```bash
php artisan make:action
```This will create a new action in `App/Actions`. You can then use the action in one of two ways:
```php
$action = new SomeAction();
$action->run();
```Or you can use the `run` helper function:
```php
run(SomeAction::class);
```You can pass arguments for the action's run method as the subsequent arguments for the helper method:
```php
run(SomeAction::class, $arg);
run(SomeAction::class, $arg1, $arg2);
```## License
MIT license. Please see the [license file](LICENSE.md) for more information.
[icon-tests]: https://img.shields.io/github/workflow/status/henrywhitaker3/laravel-actions/PHP%20Composer/master?label=Tests&logoColor=%234c1&style=flat-square
[icon-styleci]: https://github.styleci.io/repos/335909164/shield?branch=master
[icon-version]: https://img.shields.io/packagist/v/henrywhitaker3/laravel-actions?style=flat-square&label=Version[link-styleci]: https://github.styleci.io/repos/335909164
[link-packagist]: https://packagist.org/packages/henrywhitaker3/laravel-actions