seeder-migration-issues

This commit is contained in:
RafficMohammed
2023-01-30 14:23:34 +05:30
parent 4d918c722f
commit 2ec836b447
3628 changed files with 116006 additions and 187 deletions

View File

@@ -0,0 +1,42 @@
<?php namespace Davibennun\LaravelPushNotification;
use Sly\NotificationPusher\PushManager,
Sly\NotificationPusher\Model\Device,
Sly\NotificationPusher\Model\Message,
Sly\NotificationPusher\Model\Push;
class App {
public function __construct($config)
{
$this->pushManager = new PushManager($config['environment'] == "development" ? PushManager::ENVIRONMENT_DEV : PushManager::ENVIRONMENT_PROD);
$adapterClassName = 'Sly\\NotificationPusher\\Adapter\\'.ucfirst($config['service']);
$adapterConfig = $config;
unset($adapterConfig['environment'], $adapterConfig['service']);
$this->adapter = new $adapterClassName($adapterConfig);
}
public function to($addressee)
{
$this->addressee = is_string($addressee) ? new Device($addressee) : $addressee;
return $this;
}
public function send($message, $options = array()) {
$push = new Push($this->adapter, $this->addressee, ($message instanceof Message) ? $message : new Message($message, $options));
$this->pushManager->add($push);
$this->pushManager->push();
return $this;
}
public function getFeedback() {
return $this->pushManager->getFeedback($this->adapter);
}
}

View File

@@ -0,0 +1,14 @@
<?php namespace Davibennun\LaravelPushNotification\Facades;
use Illuminate\Support\Facades\Facade;
class PushNotification extends Facade {
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor() { return 'pushNotification'; }
}

View File

@@ -0,0 +1,48 @@
<?php namespace Davibennun\LaravelPushNotification;
use Illuminate\Support\ServiceProvider,
Davibennun\LaravelPushNotification\PushNotification;
class LaravelPushNotificationServiceProvider extends ServiceProvider {
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
$this->package('davibennun/laravel-push-notification');
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app['pushNotification'] = $this->app->share(function($app)
{
return new PushNotification();
});
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return array();
}
}

View File

@@ -0,0 +1,53 @@
<?php namespace Davibennun\LaravelPushNotification;
class PushNotification {
public function app($appName)
{
$config = is_array($appName) ? $appName : \Config::get('laravel-push-notification::'.$appName);
return new App($config);
}
public function Message()
{
$instance = (new \ReflectionClass('Sly\NotificationPusher\Model\Message'));
return $instance->newInstanceArgs(func_get_args());
}
public function Device()
{
$instance = (new \ReflectionClass('Sly\NotificationPusher\Model\Device'));
return $instance->newInstanceArgs(func_get_args());
}
public function DeviceCollection()
{
$instance = (new \ReflectionClass('Sly\NotificationPusher\Collection\DeviceCollection'));
return $instance->newInstanceArgs(func_get_args());
}
public function PushManager()
{
$instance = (new \ReflectionClass('Sly\NotificationPusher\PushManager'));
return $instance->newInstanceArgs(func_get_args());
}
public function ApnsAdapter()
{
$instance = (new \ReflectionClass('Sly\NotificationPusher\Adapter\ApnsAdapter'));
return $instance->newInstanceArgs(func_get_args());
}
public function GcmAdapter()
{
$instance = (new \ReflectionClass('Sly\NotificationPusher\Model\GcmAdapter'));
return $instance->newInstanceArgs(func_get_args());
}
public function Push()
{
$instance = (new \ReflectionClass('Sly\NotificationPusher\Model\Push'));
return $instance->newInstanceArgs(func_get_args());
}
}