Skip to content

Commit

Permalink
initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
fahedtms committed May 8, 2022
1 parent fd9415a commit cbbe48f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The package will automatically register itself.
You must publish the config with:

```bash
php artisan vendor:publish --provider="Fahedaljghine\ExceptionMail\ExceptionMailServiceProvider" --tag="config
php artisan vendor:publish --provider="Fahedaljghine\ExceptionMail\ExceptionMailServiceProvider" --tag="config"
```

This is the contents of the file which will be published at `config/exception-mail.php`
Expand All @@ -40,6 +40,15 @@ return [
];
```


You can publish the blade email template with:

```bash
php artisan vendor:publish --provider="Fahedaljghine\ExceptionMail\ExceptionMailServiceProvider" --tag="blade"
```

The blade file which will be published at `views/emails/exception-mail.blade.php`

### Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
Expand Down
File renamed without changes.
18 changes: 6 additions & 12 deletions src/ExceptionMailServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,19 @@ class ExceptionMailServiceProvider extends ServiceProvider
public function boot()
{

$configPath = __DIR__ . '/../config/config.php';
$configKey = 'exception-mail';


$this->publishes([
$configPath => config_path("$configKey.php"),
]);
__DIR__ . '/../config/exception-mail.php' => config_path('exception-mail.php'),
], 'config');

$this->publishes([
__DIR__ . '/../resources/emails' => resource_path('views/emails'),
]);

$this->mergeConfigFrom(
$configPath, $configKey
);
], 'blade');
}

public function register()
{
$this->app->singleton(ExceptionHandler::class, Handler::class);

$this->mergeConfigFrom(__DIR__ . '/../config/exception-mail.php', 'exception-mail');
}
}
}

0 comments on commit cbbe48f

Please sign in to comment.