<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Paulo Castellano</title>
    <description>The latest articles on DEV Community by Paulo Castellano (@paulocastellano).</description>
    <link>https://dev.to/paulocastellano</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F567316%2F195ffe3c-6e82-490e-be0f-219281bee12b.png</url>
      <title>DEV Community: Paulo Castellano</title>
      <link>https://dev.to/paulocastellano</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/paulocastellano"/>
    <language>en</language>
    <item>
      <title>I built the email infrastructure I always wished existed</title>
      <dc:creator>Paulo Castellano</dc:creator>
      <pubDate>Tue, 07 Apr 2026 21:47:41 +0000</pubDate>
      <link>https://dev.to/paulocastellano/i-built-the-email-infrastructure-i-always-wished-existed-2nmi</link>
      <guid>https://dev.to/paulocastellano/i-built-the-email-infrastructure-i-always-wished-existed-2nmi</guid>
      <description>&lt;p&gt;I run a few SaaS products. For a long time I was paying around $300/month across two separate tools: one for transactional email and another for marketing and sequences.&lt;/p&gt;

&lt;p&gt;The cost was annoying. But the real problem was the manual work. Opening the tool, building templates, setting up drip campaigns... as a developer, that always felt like a waste of time.&lt;/p&gt;

&lt;p&gt;The turning point came from a conversation with Pedro Campos, founder of &lt;a href="https://templated.io" rel="noopener noreferrer"&gt;templated.io&lt;/a&gt;. He told me he had given up on finding an email tool because none of them had MCP support. When he said that I thought: if even we, as developers, do not want to do this manually, nobody does.&lt;/p&gt;

&lt;p&gt;I searched the market. Found nothing like what I had in mind. So I wrote the first line of code for &lt;a href="https://sendkit.dev?utm_source=dev-to&amp;amp;utm_medium=post&amp;amp;utm_campaign=i-built-email-infra" rel="noopener noreferrer"&gt;Sendkit&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here is what I learned along the way:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The AHA moment has to be fast&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I used PostHog to track where users were getting stuck. The AHA moment for Sendkit is sending the first email. So I rebuilt the entire onboarding around that. You grab your API key, we show you the SDK, and you are sending in literally one minute.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nobody wants to build email sequences manually&lt;/strong&gt;&lt;br&gt;
That is why Sendkit is MCP native. You tell your AI agent to create an onboarding sequence for your SaaS and it builds everything: templates and automations. I recorded a demo where I create a 14 day onboarding with 7 emails for my own product Changelogfy. The MCP visited the site, understood the colors, grabbed the logo, understood the product and built all the templates by itself. What would have taken me days was done in 3 minutes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Suppression lists should be automatic&lt;/strong&gt;&lt;br&gt;
Nobody cleans their list. So the list has to clean itself. A bounce goes straight to suppression. Marked as spam, same thing. Your sending reputation stays protected without you having to think about it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real email validation&lt;/strong&gt;&lt;br&gt;
We also have a separate validation API. You send an address and we tell you if it is real, disposable, catch-all or a role email like admin{@} or info{@}. Use it at signup to block fakes before they hit your list.&lt;/p&gt;

&lt;p&gt;After a closed beta with over 5 million emails sent, we opened to everyone. Already past 100 customers.&lt;/p&gt;

&lt;p&gt;If you are tired of paying for multiple tools that still require manual work, check out &lt;a href="https://sendkit.dev?utm_source=dev-to&amp;amp;utm_medium=post&amp;amp;utm_campaign=i-built-email-infra" rel="noopener noreferrer"&gt;Sendkit&lt;/a&gt;. 3,000 emails free per month, no credit card required.&lt;/p&gt;

</description>
      <category>automation</category>
      <category>mcp</category>
      <category>productivity</category>
      <category>showdev</category>
    </item>
    <item>
      <title>How to make Vite, Valet, and SSL works together</title>
      <dc:creator>Paulo Castellano</dc:creator>
      <pubDate>Fri, 01 Jul 2022 19:34:59 +0000</pubDate>
      <link>https://dev.to/paulocastellano/how-to-make-vite-valet-and-ssl-works-together-5hbb</link>
      <guid>https://dev.to/paulocastellano/how-to-make-vite-valet-and-ssl-works-together-5hbb</guid>
      <description>&lt;p&gt;Hey 👋&lt;/p&gt;

&lt;p&gt;I decided to create a new project today, then I created a new laravel project and it's coming with a new assets compiler, vite.&lt;/p&gt;

&lt;p&gt;But my project requires SSL in local development, then I needed to make the vite works together with SSL and laravel valet.&lt;/p&gt;

&lt;p&gt;I did not find much content on the internet about it, because it's a very new release, then I decided to share the solution with you.&lt;/p&gt;

&lt;p&gt;Let's go, first assure your domain already have SSL with the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd ~/Code/your-current-project
valet secure your-current-project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now check in the browser your domain it's working with the certificate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;The magic is you pass the key and cert to vite.config.js as you make in Nginx or Apache.&lt;/p&gt;

&lt;p&gt;Check the file example bellow 👇&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import vue from '@vitejs/plugin-vue';

 const domain = "domain.test"; // add it
 const homedir = require("os").homedir(); // add it

export default defineConfig({
    plugins: [
        laravel({
            input: "resources/js/app.js",
            ssr: "resources/js/ssr.js",
        }),
        vue({
            template: {
                transformAssetUrls: {
                    base: null,
                    includeAbsolute: false,
                },
            },
        }),
    ],
    // add this block
    server: {
        https: {
            key: homedir + "/.config/valet/Certificates/" + domain + ".key",
            cert: homedir + "/.config/valet/Certificates/" + domain + ".crt",
        },
        host: domain,
        hmr: {
            host: domain,
        },
    },
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I hope this article helped you!&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>vite</category>
      <category>ssl</category>
      <category>valet</category>
    </item>
    <item>
      <title>How to use Repositories in Laravel Framework, so as not to repeat code</title>
      <dc:creator>Paulo Castellano</dc:creator>
      <pubDate>Fri, 11 Mar 2022 17:19:35 +0000</pubDate>
      <link>https://dev.to/paulocastellano/how-to-use-repositories-in-laravel-framework-so-as-not-to-repeat-code-l6</link>
      <guid>https://dev.to/paulocastellano/how-to-use-repositories-in-laravel-framework-so-as-not-to-repeat-code-l6</guid>
      <description>&lt;p&gt;One of the big problems in software development is code repetition, which adds a lot of difficulties when it comes to project maintenance.&lt;/p&gt;

&lt;p&gt;There is a concept in software development called &lt;strong&gt;DRY&lt;/strong&gt; (The Don't Repeat Yourself), this concept proposes that you do not repeat your code, if you need to do the same action, in more than one place in your project, you must create an abstraction for that.&lt;/p&gt;

&lt;p&gt;To apply the DRY concept in the Laravel framework, there are some architectures developed by the community, today we are just going to talk about Repositories.&lt;/p&gt;

&lt;p&gt;Imagine the following scenario, you have a system where the user can register alone to have access to a logged-in area, but someone who is already registered in the system can also invite that same user through an invitation.&lt;/p&gt;

&lt;p&gt;It's not hard to see that you'll need two codes to register a user, one outside the application and one inside.&lt;/p&gt;

&lt;p&gt;Well, to solve this kind of situation, we will use a Repository called "UserRepository.php"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzfbn2njmhbedds4lxo8a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzfbn2njmhbedds4lxo8a.png" alt="UserRepository - Laravel" width="800" height="519"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;UserRepository.php is an abstraction that we can call wherever we like.&lt;/p&gt;

&lt;p&gt;In our example, we will have two controllers, RegisterController.php (for external registers) and UsersControllers.php (for internal registers).&lt;/p&gt;

&lt;p&gt;As you can see, I can call UserRepository.php from both controllers and I'm not repeating myself.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyg1qu6qqnv8cmdhy41ds.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyg1qu6qqnv8cmdhy41ds.png" alt="RegisterController - Laravel" width="800" height="764"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I can also make the same call from the UsersController.php controller&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdu7ur61t387zlkylktgo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdu7ur61t387zlkylktgo.png" alt="UsersControler - Laravel" width="800" height="764"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This way, you can make your software maintenance much simpler and more efficient.&lt;/p&gt;

&lt;p&gt;Because when you need to fix a bug or implement a new feature, you know you only need to edit UserRepository.php&lt;/p&gt;

&lt;p&gt;Repositories also serve to facilitate cache reprocessing, imagine that you redo the user cache using several different methods of your application, with repositories that you will always call from the same method.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>php</category>
    </item>
    <item>
      <title>How to work with laravel, inertia js, and vue-i18n</title>
      <dc:creator>Paulo Castellano</dc:creator>
      <pubDate>Mon, 07 Mar 2022 12:11:05 +0000</pubDate>
      <link>https://dev.to/paulocastellano/how-to-work-with-laravel-inertia-js-and-vue-i18n-26ih</link>
      <guid>https://dev.to/paulocastellano/how-to-work-with-laravel-inertia-js-and-vue-i18n-26ih</guid>
      <description>&lt;p&gt;The last week i lost some hours trying to make &lt;a href="https://inertiajs.com/" rel="noopener noreferrer"&gt;inertia js&lt;/a&gt; and &lt;a href="https://kazupon.github.io/vue-i18n/" rel="noopener noreferrer"&gt;vue-i18n&lt;/a&gt; works together in &lt;a href="https://changelogfy.com" rel="noopener noreferrer"&gt;changelogfy&lt;/a&gt;. But some people from inertiajs discord community help to understand and make it works, very thanks 🙏&lt;/p&gt;

&lt;p&gt;To help some people to understand the process, I decided to create this post blog.&lt;/p&gt;

&lt;p&gt;I will centralize all my languages files at laravel default translates, in the folder resources/lang.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F89c91q4lw2ytxmtt17go.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F89c91q4lw2ytxmtt17go.png" alt="laravel lang folder" width="548" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I think is a great way to deliver i18n to the front and backend with the same translated files.&lt;/p&gt;

&lt;p&gt;But vuejs requires JSON language files, not PHP. &lt;/p&gt;

&lt;p&gt;To convert all our PHP translate files to JSON, we will install the composer package bellow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require librenms/laravel-vue-i18n-generator
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Publish the package configs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan vendor:publish &lt;span class="nt"&gt;--provider&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"MartinLindhe&lt;/span&gt;&lt;span class="se"&gt;\V&lt;/span&gt;&lt;span class="s2"&gt;ueInternationalizationGenerator&lt;/span&gt;&lt;span class="se"&gt;\G&lt;/span&gt;&lt;span class="s2"&gt;eneratorProvider"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's run this command to convert files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan vue-i18n:generate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A file will be created by default in &lt;strong&gt;resources/js/vue-i18n-locales.generated.js&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This file contains all your languages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt;&lt;br&gt;
You need run the command above every time you added new translations or every deployment of your application!&lt;/p&gt;

&lt;p&gt;Now let's install the vue-i18n package.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;vue-i18n@next
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you like to give power to user changes automatically your language, you can send locale to view by HandleInertiaRequests middleware.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App\Http\Middleware&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Support\Facades\Session&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Http\Request&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Inertia\Middleware&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;HandleInertiaRequests&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Middleware&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="nv"&gt;$rootView&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'app'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;version&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Request&lt;/span&gt; &lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;parent&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;version&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;share&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Request&lt;/span&gt; &lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;array_merge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;parent&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;share&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="s1"&gt;'user'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;user&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="s1"&gt;'locale'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;app&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getLocale&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;]);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's set up the &lt;strong&gt;resources/js/app.js&lt;/strong&gt;, to use vue-18n and use the current user language send by HandleInertiaRequests middleware.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createI18n&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vue-i18n&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;localeMessages&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./vue-i18n-locales.generated&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createApp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;h&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createInertiaApp&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@inertiajs/inertia-vue3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;createInertiaApp&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`./Pages/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.vue`&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="nf"&gt;setup&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;plugin&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;i18n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createI18n&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="na"&gt;locale&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;initialPage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;locale&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// user locale by props&lt;/span&gt;
            &lt;span class="na"&gt;fallbackLocale&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;en&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// set fallback locale&lt;/span&gt;
            &lt;span class="na"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;localeMessages&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// set locale messages&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;createApp&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;render&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;h&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;plugin&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i18n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mixin&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
                &lt;span class="na"&gt;methods&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="nx"&gt;route&lt;/span&gt;
                &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="p"&gt;})&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can use vue-18n in any view like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
    &amp;lt;h1&amp;gt;
        {{ t("home.title") }}
    &amp;lt;/h1&amp;gt;
&amp;lt;/template&amp;gt;
&amp;lt;script&amp;gt;
import { useI18n } from "vue-i18n";
export default {
    setup() {
        const { t } = useI18n({});
        return { t };
    },
}
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I hope I helped you ✌️&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
