<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jeri Chen on Medium]]></title>
        <description><![CDATA[Stories by Jeri Chen on Medium]]></description>
        <link>https://medium.com/@jerichen?source=rss-d38fa0766f96------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rmoQIzZfIsV-x8m9bXt49g@2x.jpeg</url>
            <title>Stories by Jeri Chen on Medium</title>
            <link>https://medium.com/@jerichen?source=rss-d38fa0766f96------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 01:31:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jerichen/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[[Laravel 5.7] 第一個package]]></title>
            <link>https://medium.com/@jerichen/laravel-5-7-%E7%AC%AC%E4%B8%80%E5%80%8Bpackage-285ce963ae45?source=rss-d38fa0766f96------2</link>
            <guid isPermaLink="false">https://medium.com/p/285ce963ae45</guid>
            <dc:creator><![CDATA[Jeri Chen]]></dc:creator>
            <pubDate>Mon, 17 Sep 2018 02:36:12 GMT</pubDate>
            <atom:updated>2019-07-07T13:56:05.429Z</atom:updated>
            <content:encoded><![CDATA[<p>laravel-package-convert-html-amp</p><p>這是第一個package，順手就記錄一下。</p><p><a href="https://github.com/jerichen/laravel-convert-html-to-amp">jerichen/laravel-convert-html-to-amp</a></p><p>公司專案推廣AMP</p><p>需求 : 將原有文章HTML格式轉換成支援AMP的格式。</p><p>實作 : 後台寫支Helper，儲存同時儲存一份AMP格式。</p><p>目標 : Helper 抽成package。</p><p>流程 :</p><p>1.開一個Laravel 5.7專案</p><pre>composer create-project laravel/laravel laravel-convert-html-to-amp</pre><p>2.建立packages foler</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/255/1*XfJqGm1i19KMn6bTANl0KQ.png" /></figure><pre>/packages/[開發商名]/[套件名]/src</pre><pre>/packages/jerichen/amp/src</pre><p>3. 建立composer.json</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*Hu8r-NLaO59Xwj8W5QHLsg.png" /></figure><pre>cd /packages/jerichen/amp</pre><pre>composer init</pre><p>4.專案目錄composer.json psr-4</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*AbnCno-TothlmSv7xF_tDQ.png" /></figure><blockquote>加入新的namespace : Jerichen\Amp</blockquote><p>5.專案目錄下產生新的autoload檔案</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*UWETc9ttY-pASfZ1Znl5IA.png" /></figure><p>6.在src建立Article.php</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*CUiBcVy5048EZ0Ue4YghVQ.png" /></figure><p>7. 建立測試，並在app/routes/web.php 新增route</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*Hq8ZvWLYSI2AcCpbKUhEow.png" /></figure><pre><em>use </em>Jerichen\Amp\Article;<br><br>Route::get(&#39;article&#39;, <em>function </em>() {<br>    $article = <em>new </em>Article();<br>    <em>return </em>$article-&gt;result();<br>});</pre><pre>Route::get(&#39;article&#39;, &#39;ArticleController@index&#39;);</pre><p>8.上傳到github</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*8Cta4ZWiGYfdHjkGz3yztw.png" /></figure><pre><a href="https://github.com/jerichen/laravel-convert-html-to-amp">https://github.com/jerichen/laravel-convert-html-to-amp</a></pre><pre>接著在amp資料夾下建立git<br>git init<br>.........<br>.........<br>略</pre><pre>請一定要記得下tag，並且在之後所有push的版本都加上tag，<br>這樣packagist才有依據要抓哪一個版本的程式碼給使用者</pre><pre>git tag -a tag_name -m &quot;First version&quot;<br>git push --tags</pre><pre>移除tag<br>git push --delete origin tag_name</pre><p>9.上傳到packagist</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rI0XHV4U7D4TxiAOPMwtxg.png" /></figure><pre><a href="https://packagist.org/packages/jerichen/laravel-convert-html-to-amp">https://packagist.org/packages/jerichen/laravel-convert-html-to-amp</a></pre><p>參考文件 :</p><p><a href="https://oomusou.io/laravel/laravel-package-hello-world/">https://oomusou.io/laravel/laravel-package-hello-world</a></p><p><a href="https://medium.com/back-ends/laravel-5-%E6%92%B0%E5%AF%AB%E4%BD%A0%E7%9A%84package-458c93c279bc">https://medium.com/back-ends/laravel-5-%E6%92%B0%E5%AF%AB%E4%BD%A0%E7%9A%84package-458c93c279bc</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=285ce963ae45" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>