/** * Return message instance. * * @param string $type * * @return mixed * * @throws InvalidArgumentException */ public function make($type = self::TEXT) { if (!defined(__CLASS__ . '::' . strtoupper($type))) { throw new InvalidArgumentException("Error Message Type '{$type}'"); } return $this->app->get("message.{$type}"); }
/** * Register Server. * * @param Application $app * * @return mixed|void */ public function register(Application $app) { $app->bind('user', function ($app) { return new User($app['http']); }); $app->bind('user.group', function ($app) { return new Group($app['http']); }); }
/** * Register service. * * @param Application $app * * @return mixed */ public function register(Application $app) { $app->singleton('material', function ($app) { return new Material($app['http']); }); $app->singleton('material.temporary', function ($app) { return new Temporary($app['http']); }); }
/** * Register Server. * * @param Application $app * * @return mixed|void */ public function register(Application $app) { $app->bind('staff', function ($app) { return new Manager($app['http']); }); $app->bind('staff.messagener', function ($app) { return new Messagener($app['http'], new Transformer()); }); }
/** * Register Server. * * @param Application $app * * @return mixed|void */ public function register(Application $app) { $app->bind('cache', function ($app) { return new Manager($app); }); // default adapter $app->bind('cache.adapter', function ($app) { return new FileAdapter(); }); }
/** * Register service. * * @param Application $app * * @return mixed */ public function register(Application $app) { $app->singleton('message', function ($app) { return new MessageFactory($app); }); $messages = ['Text', 'Articles', 'Article', 'Image', 'Link', 'Location', 'Music', 'Transfer', 'ShortVideo', 'Video', 'Voice']; foreach ($messages as $message) { $app->bind('message.' . Str::snake($message), function ($app) use($message) { $class = __NAMESPACE__ . '\\' . $message; return new $class(); }, false); } }
/** * Register Server. * * @param Application $app * * @return mixed|void */ public function register(Application $app) { $app->bind('url', function ($app) { return new Url($app['http']); }); }
/** * Register Server. * * @param Application $app * * @return mixed|void */ public function register(Application $app) { $app->bind('store', function ($app) { return new Stats($app['http']); }); }
/** * Register Server. * * @param Application $app * * @return mixed|void */ public function register(Application $app) { $app->bind('semantic', function ($app) { return new Semantic($app->config['app_id'], $app['http']); }); }
/** * Register Server. * * @param Application $app * * @return mixed|void */ public function register(Application $app) { $app->bind('qrcode', function ($app) { return new QRCode($app['http']); }); }
/** * Register Server. * * @param Application $app * * @return mixed|void */ public function register(Application $app) { $app->bind('js', function ($app) { return new Js($app['config']['app_id'], $app['config']['secret'], $app['cache'], $app['http']); }); }
/** * Register service. * * @param Application $app * * @return mixed */ public function register(Application $app) { $app->singleton('menu', function ($app) { return new Menu($app['http']); }); }
/** * Register Server. * * @param Application $app * * @return mixed|void */ public function register(Application $app) { $app->bind('server', function ($app) { return new Guard($app['input'], $app['cryptor']); }); }