From 8c129c0e08a5d452543901f2fff8b015675ec98a Mon Sep 17 00:00:00 2001 From: Luca Di Fazio <65017775+HighLiuk@users.noreply.github.com> Date: Wed, 8 Feb 2023 11:08:30 +0100 Subject: [PATCH] Allow Laravel 5.7 --- composer.json | 10 +++++----- src/Components/Button/AbstractButton.php | 7 +------ src/Widgets/AbstractWidget.php | 7 +------ 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/composer.json b/composer.json index 35ef1a7..1bac70e 100644 --- a/composer.json +++ b/composer.json @@ -12,14 +12,14 @@ } ], "require": { - "php": ">=8.0", + "php": ">=7.3", "guzzlehttp/guzzle": "^6.3 || ^7.0", - "illuminate/notifications": "^9.0.2", - "illuminate/support": "^9.0.2" + "illuminate/notifications": "^5.7", + "illuminate/support": "^5.7" }, "require-dev": { - "orchestra/testbench": "^7.0", - "phpunit/phpunit": "^9.5.10" + "orchestra/testbench": "3.7.*", + "phpunit/phpunit": "^7.5" }, "autoload": { "psr-4": { diff --git a/src/Components/Button/AbstractButton.php b/src/Components/Button/AbstractButton.php index 49359a1..35fe9e4 100644 --- a/src/Components/Button/AbstractButton.php +++ b/src/Components/Button/AbstractButton.php @@ -38,12 +38,7 @@ public function url(string $url): self */ public function toArray() { - $class = Str::of( - Str::of(get_called_class()) - ->explode('\\') - ->last() - ) - ->camel(); + $class = Str::camel(class_basename(static::class)); return [ (string) $class => $this->payload, diff --git a/src/Widgets/AbstractWidget.php b/src/Widgets/AbstractWidget.php index c6619d0..f6647c4 100644 --- a/src/Widgets/AbstractWidget.php +++ b/src/Widgets/AbstractWidget.php @@ -21,12 +21,7 @@ abstract class AbstractWidget implements Arrayable */ public function toArray() { - $widgetName = Str::of( - Str::of(get_called_class()) - ->explode('\\') - ->last() - ) - ->camel(); + $widgetName = Str::camel(class_basename(static::class)); return [ (string) $widgetName => $this->payload,