rockbuzz / lara-activities
Lara Activities is a package that monitors activities for creating, editing, and deleting features, including manipulations of related tables.
Installs: 4 709
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 1
Requires
- php: >=7.3
- ext-json: *
- fico7489/laravel-pivot: ^3.0
- laravel/framework: ^7.0|^8.0|^9.0
Requires (Dev)
- orchestra/testbench: ^5.0
- phpunit/phpunit: ^9.0
- squizlabs/php_codesniffer: ^3.5
README
Lara Activities is a Laravel package that monitors activities for creating, editing, and deleting features, including manipulations of related tables.
Requirements
PHP: >=7.3
Install
$ composer require rockbuzz/lara-activities
$ php artisan vendor:publish --provider="Rockbuzz\LaraActivities\ServiceProvider" --tag=migrations
$ php artisan migrate
Usage
namespace App; use Illuminate\Database\Eloquent\Model; use Rockbuzz\LaraActivities\Traits\RecordsActivity; class Post extends Model { use RecordsActivity; //optional define activity table //public function __construct(array $attributes = []) //{ // parent::__construct($attributes); // // $this->activityTable = 'post_activities'; //} }
Configuration
$ php artisan vendor:publish --provider="Rockbuzz\LaraActivities\ServiceProvider" --tag=config
You can define the layout of the views
'views' => [ 'layout' => 'layouts.admin' ]
You can override routes, controllers and middleware
'routes' => [ 'index' => [ 'uri' => 'admin/activities', 'as' => 'admin.activities', 'middleware' => ['web', 'auth'], 'uses' => 'Rockbuzz\LaraActivities\Controllers\ActivitiesController@index' ] ]
You can define which models will be searched in the activity table
'subjects_class' => [ 'App\Post', 'App\Comment' ],
You can also customize the views
$ php artisan vendor:publish --provider="Rockbuzz\LaraActivities\ServiceProvider" --tag=views
You can also customize the lang
$ php artisan vendor:publish --provider="Rockbuzz\LaraActivities\ServiceProvider" --tag=lang
License
The Lara Activities is open-sourced software licensed under the MIT license.