<?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>Forem: Bowen</title>
    <description>The latest articles on Forem by Bowen (@bowenhan).</description>
    <link>https://forem.com/bowenhan</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%2F3436803%2F93832a7a-f711-4fd4-8da2-ee8f52035c8d.jpg</url>
      <title>Forem: Bowen</title>
      <link>https://forem.com/bowenhan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/bowenhan"/>
    <language>en</language>
    <item>
      <title>Goravel v1.17 Preview: Add Process facade, simpler to call system commands</title>
      <dc:creator>Bowen</dc:creator>
      <pubDate>Sun, 26 Oct 2025 08:17:10 +0000</pubDate>
      <link>https://forem.com/goravel/goravel-v117-preview-add-process-facade-simpler-to-call-system-commands-882</link>
      <guid>https://forem.com/goravel/goravel-v117-preview-add-process-facade-simpler-to-call-system-commands-882</guid>
      <description>&lt;p&gt;facades add a new core module: Process, it's simpler to call system commands in your application. It has been merged to the master branch, thanks to the core developer &lt;a class="mentioned-user" href="https://dev.to/kkumargcc"&gt;@kkumargcc&lt;/a&gt; for the contribution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Core Features&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use the &lt;code&gt;Run&lt;/code&gt; function to execute one command.&lt;/li&gt;
&lt;li&gt;Use the &lt;code&gt;Pipe&lt;/code&gt; function to execute multiple commands.&lt;/li&gt;
&lt;li&gt;Use the &lt;code&gt;Pool&lt;/code&gt; function to execute command concurrently.&lt;/li&gt;
&lt;li&gt;Provide multiple functions to judge and operate the execution result.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Usage Guide&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
// Run
result, err := facades.Process().Run("echo", "Hello, World!")

// Pipe
result, err := facades.Process().Pipe(func(pipe contracts.Pipe) {
  pipe.Command("echo", "Hello, World!")
  pipe.Command("grep", "World")
  pipe.Command("tr", "a-z", "A-Z")
}).Run()

// Pool
poolResults, err := facades.Process().Pool(func(pool contracts.Pool) {
  pool.Command("sleep", "1").As("sleep1")
  pool.Command("echo", "hello").As("echo1")
  pool.Command("echo", "world").As("echo2")
}).Run()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;For details in PR: &lt;a href="https://github.com/goravel/framework/pull/1232" rel="noopener noreferrer"&gt;https://github.com/goravel/framework/pull/1232&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>go</category>
    </item>
    <item>
      <title>Goravel v1.16.4 has been released</title>
      <dc:creator>Bowen</dc:creator>
      <pubDate>Sun, 26 Oct 2025 04:27:39 +0000</pubDate>
      <link>https://forem.com/goravel/goravel-v1164-has-been-released-1adp</link>
      <guid>https://forem.com/goravel/goravel-v1164-has-been-released-1adp</guid>
      <description>&lt;h2&gt;
  
  
  Fix commands cannot be run concurrently
&lt;/h2&gt;

&lt;p&gt;Suppose there are three commands: Test1, Test2, and Test3, they will print:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
func (r *Test1) Handle(ctx console.Context) error {
  facades.Log().Info("app:test[*] start")
  facades.Log().Info("app:test[*] end")
  return nil
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then register them in the Schedule module and execute once per second:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
func (kernel *Kernel) Schedule() []schedule.Event {
  return []schedule.Event{
    facades.Schedule().Command("app:test1").EverySecond(),
    facades.Schedule().Command("app:test2").EverySecond(),
    facades.Schedule().Command("app:test3").EverySecond(),
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the Schedule module:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;facades.Schedule().Run()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Previously, the three commands were called randomly, the result is unexpected:&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%2Fmh29uf56ptbtels4jcoa.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%2Fmh29uf56ptbtels4jcoa.png" alt=" " width="800" height="474"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Currently, they can be run expectantly:&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%2Fzibsn8t41tsk61tvxr6v.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%2Fzibsn8t41tsk61tvxr6v.png" alt=" " width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>go</category>
    </item>
    <item>
      <title>Goravel v1.17 Preview: Sending emails supports rendering with view templates</title>
      <dc:creator>Bowen</dc:creator>
      <pubDate>Fri, 15 Aug 2025 08:48:36 +0000</pubDate>
      <link>https://forem.com/goravel/goravel-v117-preview-sending-emails-supports-rendering-with-view-templates-19ge</link>
      <guid>https://forem.com/goravel/goravel-v117-preview-sending-emails-supports-rendering-with-view-templates-19ge</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Goravel - A high-performance, full-featured, and easily extensible Golang devleopment framework. Its coding style is consistent with Laravel, makeing it the top choice for Phpers during the transition.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;New feature of the Mail module: It supports directly using view templates to render emial content, enabling developers to create beautiful emails more conveniently. It has been merged into the master branch, thanks to the core developer @kkumar-gcc for the contribution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Core Features
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Configurable template engine: Supports switching between different template engines through configration.&lt;/li&gt;
&lt;li&gt;Built-in caching mechanism: The template only needs to be parsed once, and subsequent usage directly reads from the cache.&lt;/li&gt;
&lt;li&gt;Thread safey: Supports concurrent use in multiple goroutines.&lt;/li&gt;
&lt;li&gt;Global registry: The template engines will be cached globally to avoid repeated creation.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Usage guide
&lt;/h2&gt;

&lt;p&gt;Create an email template:&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;!-- resources/views/mail/welcome.tmpl --&amp;gt;
&amp;lt;h1&amp;gt;Welcome {{.Name}}!&amp;lt;/h1&amp;gt;
&amp;lt;p&amp;gt;Thanks for joining {{.AppName}}。&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Send the email template:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;facades.Mail().
    To([]string{"user@example.com"}).
    Subject("Welcome").
    Content(mail.Content{
        View: "welcome.tmpl",
        With: map[string]any{
            "Name": "Tom",
            "AppName": "Goravel",
        },
    }).
    Send()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;See details in PR: &lt;a href="https://github.com/goravel/framework/pull/1145" rel="noopener noreferrer"&gt;https://github.com/goravel/framework/pull/1145&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>goravel</category>
      <category>go</category>
    </item>
  </channel>
</rss>
