Skip to content

Instantly share code, notes, and snippets.

@rizqidjamaluddin
Created May 8, 2015 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rizqidjamaluddin/0373bc4834e56dbd8029 to your computer and use it in GitHub Desktop.
Save rizqidjamaluddin/0373bc4834e56dbd8029 to your computer and use it in GitHub Desktop.
<?php return
[
'from' => env('NOTIFICATION_FROM_EMAIL', 'default-email@example.com'),
];
<?php
class Notifier {
protected $from;
public function __construt($fromEmail) {
$this->from = $fromEmail;
}
}
<?php
class NotifierServiceProvider extends ServiceProvider {
public function register() {
$this->app->bind(Notifier::class, function($app) {
return new Notifier($app['config']->get('notifier.from'));
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment