{"id":50668531,"url":"https://github.com/atomjoy/lara","last_synced_at":"2026-06-08T08:34:34.793Z","repository":{"id":353353495,"uuid":"1219066593","full_name":"atomjoy/lara","owner":"atomjoy","description":"Lara is a custom theme for HTML email notifications in Laravel 13.","archived":false,"fork":false,"pushed_at":"2026-05-20T14:41:44.000Z","size":5349,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-20T19:15:24.221Z","etag":null,"topics":["blade-email-template","email-notification","email-templates","html-email","html-email-template","lara-notification-email","laravel-email","laravel-email-notification","laravel-email-template","laravel-email-theme","laravel-notification","laravel-notification-email"],"latest_commit_sha":null,"homepage":"https://github.com/atomjoy/lara","language":"Blade","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atomjoy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-23T13:48:59.000Z","updated_at":"2026-05-20T15:00:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/atomjoy/lara","commit_stats":null,"previous_names":["atomjoy/lara"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/atomjoy/lara","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomjoy%2Flara","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomjoy%2Flara/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomjoy%2Flara/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomjoy%2Flara/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atomjoy","download_url":"https://codeload.github.com/atomjoy/lara/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomjoy%2Flara/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34055249,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blade-email-template","email-notification","email-templates","html-email","html-email-template","lara-notification-email","laravel-email","laravel-email-notification","laravel-email-template","laravel-email-theme","laravel-notification","laravel-notification-email"],"created_at":"2026-06-08T08:34:30.636Z","updated_at":"2026-06-08T08:34:34.778Z","avatar_url":"https://github.com/atomjoy.png","language":"Blade","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lara Email Notification Theme in Laravel 13\n\nLara is a custom theme for HTML email notifications in Laravel 13.\n\n## Install\n\n```sh\ncomposer create-project laravel/laravel:^13 test\ncd test\ncomposer require atomjoy/lara\n```\n\n### After Install\n\n```sh\n# Publish lara email images to public/vendor/lara and update logo and banner\nphp artisan vendor:publish --tag=lara-images --force\n```\n\n## Show Lara Email Theme\n\nLara email notification examples in **LaraNotificanion** class.\n\n```php\n\u003c?php\n\nuse App\\Models\\User;\nuse Illuminate\\Support\\Facades\\Route;\nuse Illuminate\\Support\\Facades\\Notification;\nuse Lara\\Notifications\\LaraNotificanion;\n\n// Set smtp settings in .env file\nRoute::get('/lara', function () {\n\n    // Make user\n    $user = User::factory()-\u003emake([\n        'email' =\u003e 'your-email@example.com'\n    ]);\n\n    // Send notification email\n    Notification::sendNow($user, new LaraNotificanion());\n\n    // Show in browser\n    return (new LaraNotificanion())-\u003etoMail($user);\n});\n```\n\n## Run\n\n```sh\nnpm install\nnpm run build\nphp artisan serve\nphp artisan serve --host=localhost --port=8000\n```\n\n## How To Use with Notifications\n\nIn the terminal, type **php artisan make:notification EmailNotification** to create notification class, then update methods.\n\n```php\n\u003c?php\n\npublic function via(object $notifiable): array\n{\n    return ['mail'];\n}\n\npublic function toMail(object $notifiable): MailMessage\n{\n    // Page url\n    $page = app()-\u003erequest-\u003egetSchemeAndHttpHost();\n    // Demo image url\n    $host = 'https://raw.githubusercontent.com/atomjoy/lara/refs/heads/main/public';\n\n    // Track views image (return image content from url)\n    // $trackingUrl = '/track/email/views/' . $this-\u003enewsletter-\u003eid . '/' . $this-\u003enotifiable-\u003eid;\n    // config([\n    //     'mail.email.tracking.image.url' =\u003e $trackingUrl\n    // ]);\n\n    // Lara config email template links and images always with https://\n    config([\n        // Show\n            'mail.email.browser' =\u003e $page . \"/email/123\",\n\n            // Change\n            // 'mail.email.link' =\u003e 'https://example.com',\n            // 'mail.email.logo' =\u003e  $host . \"/email/logo.webp\",\n            // 'mail.email.banner' =\u003e \"https://images.unsplash.com/photo-1556125574-d7f27ec36a06?q=80\u0026w=1170\u0026auto=format\u0026fit=crop\u0026ixlib=rb-4.1.0\u0026ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n\n            // Hide\n            // 'mail.email.logo' =\u003e null,\n            // 'mail.email.banner' =\u003e null,\n            // 'mail.email.browser' =\u003e null,\n\n            // Email title\n            // 'mail.email.products.title' =\u003e 'Fresh promotions',\n            // 'mail.email.events.title' =\u003e 'Upcoming live events',\n            // 'mail.email.info.title' =\u003e 'Looking for more?',\n\n            // Footer url\n            // 'mail.email.footer.logo' =\u003e 'https://example.com/footer-logo.webp',\n            // 'mail.email.footer.unsubscribe' =\u003e 'https://example.com/unsubscribe',\n            // 'mail.email.footer.policy' =\u003e 'https://example.com/policy',\n            // 'mail.email.footer.settings' =\u003e 'https://example.com/settings',\n\n            // Show footer social icons\n            'mail.email.social.instagram' =\u003e 'https://instagram.com/',\n            'mail.email.social.facebook' =\u003e 'https://facebook.com/',\n            'mail.email.social.youtube' =\u003e 'https://youtube.com/',\n            'mail.email.social.tiktok' =\u003e 'https://tiktok.com/',\n            'mail.email.social.x' =\u003e 'https://x.com/',\n    ]);\n\n    // ...\n\n    // Defaut theme events, products\n    return (new MailMessage())\n        // -\u003eerror()-\u003esuccess()\n        // -\u003esalutation('Best regards from our team')\n        -\u003esubject('Events notification')\n        -\u003egreeting('Web Interaction in the Age of AI')\n        -\u003eline('The introduction to the notification. Bold \u003cstrong\u003ehtml tekst\u003c/strong\u003e goes here. Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quos eum ex, atque, porro debitis cumque praesentium, dolore illo ullam nemo doloremque at nobis?')\n        -\u003eaction('Confirm Email Address', $page . '/confirm/email') // Dont use url() function\n        -\u003eline('Thank you for using our application, \u003ca href=\"https://example.com\" target=\"_blank\"\u003every nice!\u003c/a\u003e')\n        // Set default or mini theme and markdown\n        -\u003etheme('lara::theme.default')\n        -\u003emarkdown('lara::email.default', [\n            // Comment to hide\n            'date' =\u003e 'March 28, 4PM CET',\n            'code' =\u003e '888777',\n            'info' =\u003e 'Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quos eum ex, atque, porro debitis cumque praesentium, dolore illo ullam nemo doloremque at nobis? Nesciunt neque molestias expedita eius voluptate saepe.',\n            'products' =\u003e $products,\n            'events' =\u003e $events,\n            'news' =\u003e $news,\n        ]);\n}\n```\n\n## How To Use with Mailable\n\n```php\n\u003c?php\n\nnamespace App\\Mail;\n\nuse App\\Models\\Newsletter;\nuse App\\Models\\Social;\nuse App\\Models\\Subscriber;\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Mail\\Mailable;\nuse Illuminate\\Mail\\Mailables\\Address;\nuse Illuminate\\Mail\\Mailables\\Attachment;\nuse Illuminate\\Mail\\Mailables\\Content;\nuse Illuminate\\Mail\\Mailables\\Envelope;\nuse Illuminate\\Notifications\\Messages\\MailMessage;\nuse Illuminate\\Queue\\SerializesModels;\n\nclass NewsletterMail extends Mailable implements ShouldQueue\n{\n    use Queueable, SerializesModels;\n\n    /**\n     * Create a new message instance.\n     */\n    public function __construct(protected Newsletter $newsletter, protected Subscriber $subscriber)\n    {\n        $this-\u003eonQueue('email');\n    }\n\n    /**\n     * Get the message envelope.\n     */\n    public function envelope(): Envelope\n    {\n        return new Envelope(\n            // from: new Address('example@example.com', 'Test Sender'),\n            subject: $this-\u003enewsletter?-\u003esubject ?? '👀 Fresh Newsletter',\n        );\n    }\n\n    /**\n     * Get the message content definition.\n     */\n    public function content(): Content\n    {\n        $page = app()-\u003erequest-\u003egetSchemeAndHttpHost();\n\n        // Track views\n        $trackingUrl = $page . '/track/email/views/' . $this-\u003enewsletter-\u003eid . '/' . $this-\u003esubscriber-\u003eid;\n        config([\n            'mail.email.tracking.image.url' =\u003e $trackingUrl\n        ]);\n\n        // Banner image\n        if (isset($this-\u003enewsletter-\u003eimage)) {\n            config(['mail.email.banner' =\u003e $page . \"/image/\" . $this-\u003enewsletter-\u003eimage]);\n        } else {\n            // Show default or uncoment to remove banner\n            // config(['mail.email.banner' =\u003e null]);\n        }\n\n        foreach (Social::where('place', 'newsletter')-\u003eget() as $s) {\n            config([\n                'mail.email.social.' . strtolower($s-\u003ename) =\u003e $s-\u003eurl ?? $page,\n            ]);\n        }\n\n        $m = (new MailMessage)\n            -\u003esubject($this-\u003enewsletter-\u003esubject ?? __('👀 Fresh Newsletter'))\n            -\u003egreeting($this-\u003ereplaceName($this-\u003enewsletter-\u003etitle ?? __('👀 Fresh Newsletter')))\n            -\u003elines($this-\u003esplitLines($this-\u003enewsletter-\u003eline1 ?? ''))\n            -\u003eaction($this-\u003enewsletter-\u003ebutton ?? __('See More'), $this-\u003enewsletter-\u003eurl ?? $page)\n            -\u003elines($this-\u003esplitLines($this-\u003enewsletter-\u003eline2 ?? ''))\n            -\u003etheme('lara::theme.default')\n            -\u003emarkdown('lara::email.default', [\n                'code' =\u003e $this-\u003enewsletter-\u003ecode ?? null,\n                'date' =\u003e $this-\u003enewsletter-\u003epublished_at-\u003eformat('Y-m-d') ?? null,\n                // Comment to hide\n                // 'info' =\u003e 'Lorem ipsum dolor sit amet consectetur, adipisicing elit.',\n                // 'products' =\u003e $products,\n                // 'events' =\u003e $events,\n                // 'news' =\u003e $news,\n            ])-\u003erender();\n\n        return new Content(\n            htmlString: $m,\n        );\n    }\n\n    /**\n     * Get the attachments for the message.\n     *\n     * @return array\u003cint, Attachment\u003e\n     */\n    public function attachments(): array\n    {\n        return [];\n    }\n\n    /**\n     * Replace mustache attribute {name}.\n     *\n     * @param string $str\n     * @return string\n     */\n    public function replaceName(string $str): string\n    {\n        return str_ireplace('{name}', $this-\u003esubscriber-\u003ename, $str);\n    }\n\n    /**\n     * Markdown multiple line format\n     *\n     * @param string $str\n     * @return array\n     */\n    public function splitLines(string $str): array\n    {\n        return array_map(trim(...), preg_split('/\\\\r\\\\n|\\\\r|\\\\n/', $this-\u003ereplaceName($str) ?? ''));\n    }\n}\n```\n\n## Tracking email views\n\nCreate Newsletter and Subscriber models first. Add newsletter views column.\n\n```php\n\u003c?php\n\nuse Lara\\Actions\\TrackViewsImage;\nuse App\\Models\\Newsletter;\nuse App\\Models\\Subscriber;\n\nRoute::get('/track/email/views/{newsletter}/{subscriber}', function (\n    Newsletter $newsletter, Subscriber $subscriber, TrackViewsImage $ti\n) {\n    // Public directory 1x1px transparent png image path\n    return $ti-\u003ehandle($newsletter, $subscriber, 'default/email/tracking.png');\n});\n```\n\n## Cron\n\nSend emails from queue (or remove: implements ShouldQueue).\n\n```sh\n# Cron\ncrontab -e\n\n# Test every minute\n* * * * * /usr/bin/php /path-to-your-project/artisan queue:work --queue=high,medium,email,default --max-time=60 --sleep=5 \u003e /dev/null\n\n# Hosting every 5 min\n*/10 * * * * php84 /home/username/domains/example.com/artisan queue:work --queue=high,medium,email,default --max-time=600 --sleep=5 \u003e /dev/null\n```\n\n## Publish Theme For Edit (optional)\n\n```sh\n# In resources/views/vendor/lara\nphp artisan vendor:publish --tag=lara-views --force\n# In public/vendor/lara\nphp artisan vendor:publish --tag=lara-images --force\n# In config/lara.php\nphp artisan vendor:publish --tag=lara-config --force\n\n# Sample with provider package\nphp artisan vendor:publish --provider='Lara\\LaraServiceProvider' --tag=\"images\"\n```\n\n## Lara Email Theme\n\n\u003cimg src=\"https://raw.githubusercontent.com/atomjoy/lara/main/lara-email.webp\" width=\"100%\"\u003e\n\n### Width to 640px\n\n\u003cimg src=\"https://raw.githubusercontent.com/atomjoy/lara/main/lara-email-rwd-640.webp\" width=\"50%\"\u003e\n\n### Width to 520px\n\n\u003cimg src=\"https://raw.githubusercontent.com/atomjoy/lara/main/lara-email-rwd-520.webp\" width=\"50%\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomjoy%2Flara","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatomjoy%2Flara","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomjoy%2Flara/lists"}