You've already forked php-flasher
mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-04-05 12:32:55 +01:00
update laravel and js files
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
PHPFlasher.addFactory('noty', (function () {
|
||||
PHPFlasher.addFactory('sweet_alert', (function () {
|
||||
'use strict';
|
||||
|
||||
var exports = {};
|
||||
@@ -6,15 +6,17 @@ PHPFlasher.addFactory('noty', (function () {
|
||||
exports.render = function (data) {
|
||||
var options = {
|
||||
text: data.message,
|
||||
type: data.type,
|
||||
icon: data.type,
|
||||
...data.options
|
||||
}
|
||||
|
||||
new Noty(options).show();
|
||||
window.SwalToast.fire(options);
|
||||
};
|
||||
|
||||
exports.renderOptions = function (options) {
|
||||
Noty.overrideDefaults(options);
|
||||
if ("undefined" === typeof window.SwalToast) {
|
||||
window.SwalToast = Swal.mixin(options);
|
||||
}
|
||||
};
|
||||
|
||||
return exports;
|
||||
@@ -3,10 +3,8 @@
|
||||
namespace Flasher\SweetAlert\Laravel\ServiceProvider\Providers;
|
||||
|
||||
use Flasher\Prime\Flasher;
|
||||
use Flasher\Prime\Renderer\RendererManager;
|
||||
use Flasher\SweetAlert\Laravel\FlasherSweetAlertServiceProvider;
|
||||
use Flasher\SweetAlert\Prime\SweetAlertFactory;
|
||||
use Flasher\SweetAlert\Prime\SweetAlertRenderer;
|
||||
use Illuminate\Container\Container;
|
||||
use Illuminate\Foundation\Application;
|
||||
|
||||
@@ -36,24 +34,13 @@ class Laravel implements ServiceProviderInterface
|
||||
public function registerServices()
|
||||
{
|
||||
$this->app->singleton('flasher.factory.sweet_alert', function (Container $app) {
|
||||
return new SweetAlertFactory($app['flasher.event_dispatcher']);
|
||||
return new SweetAlertFactory($app['flasher.storage_manager']);
|
||||
});
|
||||
|
||||
$this->app->singleton('flasher.renderer.sweet_alert', function (Container $app) {
|
||||
return new SweetAlertRenderer($app['flasher.config']);
|
||||
});
|
||||
|
||||
$this->app->alias('flasher.factory.sweet_alert', 'Flasher\SweetAlert\Prime\SweetAlertFactory');
|
||||
$this->app->alias('flasher.renderer.sweet_alert', 'Flasher\SweetAlert\Prime\SweetAlertRenderer');
|
||||
$this->app->alias('flasher.sweet_alert', 'Flasher\SweetAlert\Prime\SweetAlertFactory');
|
||||
|
||||
$this->app->extend('flasher', function (Flasher $manager, Container $app) {
|
||||
$manager->addFactory($app['flasher.factory.sweet_alert']);
|
||||
|
||||
return $manager;
|
||||
});
|
||||
|
||||
$this->app->extend('flasher.renderer_manager', function (RendererManager $manager, Container $app) {
|
||||
$manager->addDriver($app['flasher.renderer.sweet_alert']);
|
||||
$manager->addFactory('sweet_alert', $app['flasher.factory.sweet_alert']);
|
||||
|
||||
return $manager;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user