From c4c0f894aabf0063b4b9d4ccc77aa678356e46a5 Mon Sep 17 00:00:00 2001 From: klgd Date: Sat, 2 Sep 2017 23:22:41 +0800 Subject: [PATCH] support laravel 5.5 --- README.md | 11 ++++++++++- composer.json | 16 ++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ef9fbaf..d0c0772 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,11 @@ Via Composer $ composer require scolib/laravel-action-log ``` -After updating composer, add the ServiceProvider to the `providers` array in `config/app.php` +Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider. + +### Laravel 5.5.* + +If you don't use auto-discovery, add the ServiceProvider to the `providers` array in `config/app.php` ```php \Sco\ActionLog\LaravelServiceProvider::class, @@ -28,6 +32,8 @@ If you want to use the facade to logging actions, add this to the `aliases` arra 'ActionLog' => Sco\ActionLog\Facade::class, ``` +## Publish config file + Copy the package config to your local config with the publish command: ```php @@ -53,6 +59,9 @@ Override the property `$events` in your Model ]; ``` +> ⚠ Note: Laravel 5.5 +> Renamed `$events` to `$dispatchesEvents` ([#17961](https://github.com/laravel/framework/pull/17961), [b6472bf](https://github.com/laravel/framework/commit/b6472bf6fec1af6e76604aaf3f7fed665440ac66), [3dbe12f](https://github.com/laravel/framework/commit/3dbe12f16f470e3bca868576d517d57876bc50af)) + All available event ```php diff --git a/composer.json b/composer.json index 266d592..22814c5 100644 --- a/composer.json +++ b/composer.json @@ -17,15 +17,15 @@ } ], "require": { - "php": "~5.6|~7.0", + "php": ">=7.0.0", "scolib/attributes": "~1.0" }, "require-dev": { - "laravel/framework": "^5.4", + "laravel/framework": "5.5.*", "mockery/mockery": "^0.9.9", "orchestra/database": "^3.4", "orchestra/testbench": "~3.4", - "phpunit/phpunit": "^5.7||^6.0", + "phpunit/phpunit": "~6.0", "squizlabs/php_codesniffer": "^3.0" }, "autoload": { @@ -45,7 +45,15 @@ }, "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.3-dev" + }, + "laravel": { + "providers": [ + "Sco\\ActionLog\\LaravelServiceProvider" + ], + "aliases": { + "ActionLog": "Sco\\ActionLog\\Facade" + } } }, "suggest": {