Skip to content

Commit

Permalink
🎉 First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Balsakup committed Mar 6, 2021
0 parents commit b1304ef
Show file tree
Hide file tree
Showing 29 changed files with 7,318 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Contributing

Contributions are **welcome** and will be fully **credited**.

Please read and understand the contribution guide before creating an issue or pull request.

## Etiquette

This project is open source, and as such, the maintainers give their free time to build and maintain the source code
held within. They make the code freely available in the hope that it will be of use to other developers. It would be
extremely unfair for them to suffer abuse or anger for their hard work.

Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the world that
developers are civilized and selfless people.

It's the duty of the maintainer to ensure that all submissions to the project are of sufficient quality to benefit the
project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do
not be upset or abusive if your submission is not used.

## Viability

When requesting or submitting new features, first consider whether it might be useful to others. Open source projects
are used by many developers, who may have entirely different needs to your own. Think about whether or not your feature
is likely to be used by other users of the project.

## Procedure

Before filing an issue:

- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
- Check to make sure your feature suggestion isn't already present within the project.
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
- Check the pull requests tab to ensure that the feature isn't already in progress.

Before submitting a pull request:

- Check the codebase to ensure that your feature doesn't already exist.
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.

## Requirements

If the project maintainer has any additional requirements, you will find them listed here.

- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)**
- The easiest way to apply the conventions is to
install [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer).

- **Add tests!** - Your patch won't be accepted if it doesn't have tests.

- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept
up-to-date.

- **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs
is not an option.

- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.

- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make
multiple intermediate commits while developing,
please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages)
before submitting.

**Happy coding**!
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
custom: https://paypal.me/balsakup
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/kapouet/laravel-notyf/discussions/new?category=q-a
about: Ask the community for help
- name: Request a feature
url: https://github.com/kapouet/laravel-notyf/discussions/new?category=ideas
about: Share ideas for new features
- name: Report a bug
url: https://github.com/kapouet/laravel-notyf/issues/new
about: Report a reproducable bug
3 changes: 3 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Security Policy

If you discover any security related issues, please email [email protected] instead of using the issue tracker.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/dist/hot
/node_modules/
/vendor/
yarn-error.log
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 kapouet

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
94 changes: 94 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
![Laravel Notyf banner](https://laravel-og.beyondco.de/Laravel%20Notyf.png?theme=dark&packageManager=composer+require&packageName=kapouet%2Flaravel-notyf&pattern=architect&style=style_1&description=Add+Notyf+support+in+your+Laravel+app&md=1&showWatermark=1&fontSize=100px&images=bell)

[![Latest Version on Packagist](https://img.shields.io/packagist/v/kapouet/laravel-notyf.svg?style=flat-square)](https://packagist.org/packages/kapouet/laravel-notyf)
[![Total Downloads](https://img.shields.io/packagist/dt/kapouet/laravel-notyf.svg?style=flat-square)](https://packagist.org/packages/kapouet/laravel-notyf)

Add [Notyf](https://github.com/caroso1222/notyf) support in your Laravel app.

## Installation

You can install the package via composer

```shell
composer require kapouet/laravel-notyf
```

You can publish the config file with:

```shell
php artisan vendor:publish --provider="Kapouet\Notyf\NotyfServiceProvider" --tag="kapouet:config"
```

The config file is structured like Notyf, but in PHP, see https://github.com/caroso1222/notyf#api

## Usage

### Import assets

```html
<!-- For CSS -->
<x-notyf::styles/>

<!-- For JS -->
<!-- Import this script after Livewire if you use it -->
<xnotyf::scripts/>
```

### Send toast with PHP

```php
Notyf::success('I\'m a success message');
Notyf::error('I\'m an error message');

// If you are added custom types in config file
// https://github.com/caroso1222/notyf#inotyfnotificationoptions
Notyf::message('custom', 'I\'m a custom message');
```

### Send toast with Livewire

```php
use Kapouet\Notyf\Traits\Livewire\WithNotyf;
use Livewire\Component;

class MyComponent extends Component
{
use WithNotyf;

public function render(): string
{
return <<<'blade'
<div>
<button wire:click="toast">Toast me</button>
</div>
blade;
}

public function toast(): void
{
$this->notyfSuccess('I\'m a success message');
$this->notyfError('I\'m an error message');

// If you are added custom types in config file
// https://github.com/caroso1222/notyf#inotyfnotificationoptions
$this->notyfMessage('custom', 'I\'m a custom message');
}
}
```

## Contributing

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

## Security Vulnerabilities

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

## Credits

- [Quentin CATHERINE](https://github.com/balsakup)
- [All Contributors](../../contributors)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
41 changes: 41 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "kapouet/laravel-notyf",
"description": "Add Notyf support in your Laravel app",
"keywords": [
"kapouet",
"notyf",
"toast",
"notification"
],
"license": "MIT",
"authors": [
{
"name": "Quentin CATHERINE",
"email": "[email protected]"
}
],
"require": {
"php": "^7.4|^8.0",
"illuminate/contracts": "^8.0"
},
"autoload": {
"psr-4": {
"Kapouet\\Notyf\\": "src"
}
},
"config": {
"sort-packages": true
},
"extra": {
"laravel": {
"providers": [
"Kapouet\\Notyf\\NotyfServiceProvider"
],
"aliases": {
"Notyf": "Kapouet\\Notyf\\Facades\\Notyf"
}
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
Loading

0 comments on commit b1304ef

Please sign in to comment.