diff --git a/README.md b/README.md index 7e6e573..6103cd4 100644 --- a/README.md +++ b/README.md @@ -25,11 +25,11 @@ composer require damilaredev/laravel-email Add the component to your email template. Include styles where needed. ```html - - + + - - + - - - - + + + Laravel Email - - - - - + + + + + ``` ## Components @@ -60,35 +60,35 @@ A set of standard components to help you build amazing emails without having to ### HTML ```html - - + + Click Me - - + + ``` ### Head ```html - + email title - + ``` ### Heading ```html -Lorem Ipsum +Lorem Ipsum ``` ### Link ```html - + Example - + ``` ### Image ```html - + ``` ### Paragraph ```html -Lorem Ipsum +Lorem Ipsum ``` ### Container ```html - + Click here - + ``` ### Body ```html - - - - + + + + {{-- First column --}} - - + + {{-- Second column --}} - - - - + + + + ``` ### Row ```html - - A - B - C - + + A + B + C + ``` ### Section ```html {{-- A Simple Section --}} - - Lorem Ipsum - + + Lorem Ipsum + {{-- Formatted with `rows` and `columns` --}} - - - Column 1, Row 1 - Column 2, Row 1 - + + + Column 1, Row 1 + Column 2, Row 1 + - - Column 1, Row 2 - Column 2, Row 2 - - + + Column 1, Row 2 + Column 2, Row 2 + + ``` ### Font ```html - - - + + - - + + ``` ## Support diff --git a/src/LaravelEmailServiceProvider.php b/src/LaravelEmailServiceProvider.php index 238f546..884edc2 100644 --- a/src/LaravelEmailServiceProvider.php +++ b/src/LaravelEmailServiceProvider.php @@ -2,7 +2,19 @@ namespace Damilaredev\LaravelEmail; -use Illuminate\Support\Facades\Blade; +use Damilaredev\LaravelEmail\View\Components\Body; +use Damilaredev\LaravelEmail\View\Components\Column; +use Damilaredev\LaravelEmail\View\Components\Container; +use Damilaredev\LaravelEmail\View\Components\Font; +use Damilaredev\LaravelEmail\View\Components\Head; +use Damilaredev\LaravelEmail\View\Components\Heading; +use Damilaredev\LaravelEmail\View\Components\Hr; +use Damilaredev\LaravelEmail\View\Components\Html; +use Damilaredev\LaravelEmail\View\Components\Img; +use Damilaredev\LaravelEmail\View\Components\Link; +use Damilaredev\LaravelEmail\View\Components\Row; +use Damilaredev\LaravelEmail\View\Components\Section; +use Damilaredev\LaravelEmail\View\Components\Text; use Illuminate\Support\ServiceProvider; class LaravelEmailServiceProvider extends ServiceProvider @@ -41,7 +53,8 @@ protected function bootPublishing(): static { if ($this->app->runningInConsole()) { $this->publishes([ - __DIR__.'/../resources/views' => $this->app->resourcePath('views/vendor/laravel-email'), + __DIR__.'/../src/View/Components/' => app_path('View/Components'), + __DIR__.'/../resources/views/components/' => resource_path('views/vendor/components/laravel-email'), ], 'laravel-email-views'); } @@ -53,10 +66,21 @@ protected function bootPublishing(): static */ protected function bootComponents(): static { - Blade::componentNamespace( - 'Damilaredev\\LaravelEmail\\View\\Components', - 'laravel-email' - ); + $this->loadViewComponentsAs('laravel-email', [ + Head::class, + Body::class, + Html::class, + Hr::class, + Row::class, + Column::class, + Section::class, + Text::class, + Img::class, + Font::class, + Link::class, + Heading::class, + Container::class, + ]); return $this; }