Skip to content

Commit

Permalink
Merge pull request #109 from mckenziearts/add-lint
Browse files Browse the repository at this point in the history
Add lint
  • Loading branch information
mckenziearts authored Mar 13, 2023
2 parents fa9fc59 + ed37854 commit 3144172
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 169 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml,scss,js,json,css}]
[*.{yml,yaml,scss,js,json,css,json}]
indent_size = 2
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

18 changes: 5 additions & 13 deletions readme.md → README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<p align="center"><img src="https://laravel.cm/img/brand/laravel-notify.svg"></p>
<p align="center"><img src="https://laravel.cm/images/laravel-notify.svg"></p>

<p align="center">
<a href="https://travis-ci.org/mckenziearts/laravel-notify"><img src="https://img.shields.io/travis/mckenziearts/laravel-notify/master.svg?style=flat-square" alt="Build Status"></a>
<a href="https://packagist.org/packages/mckenziearts/laravel-notify"><img src="https://poser.pugx.org/mckenziearts/laravel-notify/d/total.svg" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/mckenziearts/laravel-notify"><img src="https://poser.pugx.org/mckenziearts/laravel-notify/v/stable.svg" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/mckenziearts/laravel-notify"><img src="https://poser.pugx.org/mckenziearts/laravel-notify/license.svg" alt="License"></a>
<a href="https://packagist.org/packages/mckenziearts/laravel-notify"><img src="https://poser.pugx.org/mckenziearts/laravel-notify/d/total.svg" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/mckenziearts/laravel-notify"><img src="https://poser.pugx.org/mckenziearts/laravel-notify/v/stable.svg" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/mckenziearts/laravel-notify"><img src="https://poser.pugx.org/mckenziearts/laravel-notify/license.svg" alt="License"></a>
</p>

## Introduction
Expand All @@ -13,16 +12,9 @@ Laravel Notify is a package that lets you add custom notifications to your proje
A diverse range of notification design is available.

<p align="center">
<img src="https://i.imgur.com/mZVVn3L.png">
<img src="https://i.imgur.com/mZVVn3L.png">
</p>

## Version Guidance

| Version | Laravel version | Status | Branch | Install |
|---------|-----------------------|-----------------|--------|-----------------------------------------------------|
| 1.x | 5.5, 5.6, 5.7, 6.0 | EOL | 1.0 | composer require mckenziearts/laravel-notify 1.* |
| 2.x | >= 7.0 | Latest | 2.0 | composer require mckenziearts/laravel-notify |

## Android Version

If you need Android version please try this package [Aesthetic Dialogs](https://github.com/gabriel-TheCode/AestheticDialogs). Happy Coding 👨🏾‍💻
Expand Down
89 changes: 45 additions & 44 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,48 @@
{
"name": "mckenziearts/laravel-notify",
"description": "Flexible flash notifications for Laravel",
"license": "MIT",
"authors": [
{
"name": "Arthur Monney",
"email": "[email protected]",
"homepage": "https://twitter.com/MonneyArthur",
"role": "Developer"
}
],
"homepage": "https://github.com/mckenziearts/laravel-notify",
"keywords": [
"Laravel",
"laravel-notify",
"notification"
],
"require": {
"php": ">=7.4",
"illuminate/support": "~7.0|~8.0|~9.0|^10.0"
"name": "mckenziearts/laravel-notify",
"description": "Flexible flash notifications for Laravel",
"license": "MIT",
"authors": [
{
"name": "Arthur Monney",
"email": "[email protected]",
"homepage": "https://twitter.com/MonneyArthur",
"role": "Developer"
}
],
"homepage": "https://github.com/mckenziearts/laravel-notify",
"keywords": [
"Laravel",
"laravel-notify",
"notification"
],
"require": {
"php": "~8.0",
"illuminate/support": "^8.0|^9.0|^10.0"
},
"require-dev": {
"mockery/mockery": "^1.0",
"phpunit/phpunit": "^8.0|^9.0",
"laravel/pint": "^1.6"
},
"autoload": {
"psr-4": {
"Mckenziearts\\Notify\\": "src/"
},
"require-dev": {
"mockery/mockery": "^1.0",
"phpunit/phpunit": "^8.0|^9.0"
},
"autoload": {
"psr-4": {
"Mckenziearts\\Notify\\": "src/"
},
"files": [
"src/helpers.php"
]
},
"extra": {
"laravel": {
"providers": [
"Mckenziearts\\Notify\\LaravelNotifyServiceProvider"
],
"aliases": {
"Notify": "Mckenziearts\\Notify\\Facades\\LaravelNotify"
}
}
},
"minimum-stability": "dev",
"prefer-stable": true
"files": [
"src/helpers.php"
]
},
"extra": {
"laravel": {
"providers": [
"Mckenziearts\\Notify\\LaravelNotifyServiceProvider"
],
"aliases": {
"Notify": "Mckenziearts\\Notify\\Facades\\LaravelNotify"
}
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
8 changes: 4 additions & 4 deletions config/notify.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
|
*/

'timeout' => 5000,
'timeout' => 5000,

/*
|--------------------------------------------------------------------------
Expand All @@ -52,9 +52,9 @@
// An example preset 'user updated' Connectify notification.
'user-updated' => [
'message' => 'The user has been updated successfully.',
'type' => 'success',
'model' => 'connect',
'title' => 'User Updated',
'type' => 'success',
'model' => 'connect',
'title' => 'User Updated',
],
],

Expand Down
5 changes: 0 additions & 5 deletions src/Facades/LaravelNotify.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

class LaravelNotify extends Facade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor(): string
{
return 'notify';
Expand Down
48 changes: 7 additions & 41 deletions src/LaravelNotify.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
class LaravelNotify
{
protected Session $session;

/**
* Create a new notify instance.
*
* @param Session $session
*/
public function __construct(Session $session)
{
$this->session = $session;
Expand All @@ -23,8 +17,6 @@ public function __construct(Session $session)
/**
* Flash an information message.
*
* @param string $message
* @param string|null $title
* @return $this
*/
public function info(string $message, string $title = null): self
Expand All @@ -37,8 +29,6 @@ public function info(string $message, string $title = null): self
/**
* Flash a success message.
*
* @param string $message
* @param string|null $title
* @return $this
*/
public function success(string $message, string $title = null): self
Expand All @@ -51,8 +41,6 @@ public function success(string $message, string $title = null): self
/**
* Flash an error message.
*
* @param string $message
* @param string|null $title
* @return $this
*/
public function error(string $message, string $title = null): self
Expand All @@ -65,8 +53,6 @@ public function error(string $message, string $title = null): self
/**
* Flash a warning message.
*
* @param string $message
* @param string|null $title
* @return $this
*/
public function warning(string $message, string $title = null): self
Expand All @@ -79,9 +65,6 @@ public function warning(string $message, string $title = null): self
/**
* Return a Connect Notification.
*
* @param string $type
* @param string $title
* @param string $message
* @return $this
*/
public function connect(string $type, string $title, string $message): self
Expand All @@ -96,8 +79,6 @@ public function connect(string $type, string $title, string $message): self
/**
* Return a smiley notify.
*
* @param string $type
* @param string $message
* @return $this
*/
public function smiley(string $type, string $message): self
Expand All @@ -112,8 +93,6 @@ public function smiley(string $type, string $message): self
/**
* Return a smiley notify.
*
* @param string $type
* @param string $message
* @return $this
*/
public function emotify(string $type, string $message): self
Expand All @@ -126,7 +105,6 @@ public function emotify(string $type, string $message): self
/**
* Return a drake notify.
*
* @param string $type
* @return $this
*/
public function drake(string $type): self
Expand All @@ -150,9 +128,6 @@ public function drake(string $type): self
*
* ['message' => 'Your new message here!']
*
* @param string $presetName
* @param array $overrideValues
* @return LaravelNotify
* @throws Exception
*/
public function preset(string $presetName, array $overrideValues = []): self
Expand All @@ -177,31 +152,24 @@ public function preset(string $presetName, array $overrideValues = []): self
/**
* Flash a message.
*
* @param string $message
* @param string|null $type
* @param string|null $icon
* @param string|null $model
* @param string|null $title
*
* @return void
* @param string|null $type
* @param string|null $icon
*/
public function flash(string $message, $type = null, $icon = null, string $model = null, string $title = null): void
public function flash(string $message, string $type = null, string $icon = null, string $model = null, string $title = null): void
{
$notifications = [
'message' => $message,
'type' => $type,
'icon' => $icon,
'model' => $model,
'title' => $title,
'type' => $type,
'icon' => $icon,
'model' => $model,
'title' => $title,
];

$this->session->flash('notify', $notifications);
}

/**
* Get the stored message.
*
* @return string
*/
public function message(): string
{
Expand All @@ -210,8 +178,6 @@ public function message(): string

/**
* Get the stored type.
*
* @return string
*/
public function type(): string
{
Expand Down
7 changes: 0 additions & 7 deletions src/LaravelNotifyServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ public function registerComponents(): void

/**
* Register Publishable files.
*
* @return void
*/
public function registerPublishables(): void
{
Expand All @@ -58,9 +56,4 @@ public function registerPublishables(): void
__DIR__.'/../config/notify.php' => config_path('notify.php'),
], 'notify-config');
}

public function provides(): array
{
return [];
}
}
13 changes: 1 addition & 12 deletions src/Storage/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,14 @@

class Session
{
/**
* Session storage.
*
* @var \Illuminate\Session\Store
*/
protected Store $session;

public function __construct(Store $session)
{
$this->session = $session;
}

/**
* Set a session key and value.
*
* @param string $key
* @param array $data
*/
public function flash(string $key, array $data = [])
public function flash(string $key, array $data = []): void
{
$this->session->flash($key, $data);
}
Expand Down
Loading

0 comments on commit 3144172

Please sign in to comment.