<?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: Saiks</title>
    <description>The latest articles on DEV Community by Saiks (@sykez).</description>
    <link>https://dev.to/sykez</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%2F146941%2F20f2cc36-6b80-45a0-8719-8eac82e1e36a.jpeg</url>
      <title>DEV Community: Saiks</title>
      <link>https://dev.to/sykez</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sykez"/>
    <language>en</language>
    <item>
      <title>Configure Alibaba Cloud OSS On Laravel Filesystem</title>
      <dc:creator>Saiks</dc:creator>
      <pubDate>Sat, 01 Feb 2020 17:52:37 +0000</pubDate>
      <link>https://dev.to/sykez/configure-alibaba-cloud-oss-on-laravel-filesystem-1d0c</link>
      <guid>https://dev.to/sykez/configure-alibaba-cloud-oss-on-laravel-filesystem-1d0c</guid>
      <description>&lt;p&gt;&lt;a href="https://www.alibabacloud.com/product/oss"&gt;Object Storage Service (OSS)&lt;/a&gt; is an object storage service by Alibaba Cloud (Aliyun/Ali Cloud), much similar to &lt;a href="https://aws.amazon.com/s3/"&gt;Amazon Simple Storage Service (Amazon S3)&lt;/a&gt;. &lt;a href="https://github.com/thephpleague/flysystem"&gt;Flysystem&lt;/a&gt; integration in Laravel allows easy use of local filesystems, Amazon S3, and Rackspace Cloud Storage.&lt;/p&gt;

&lt;p&gt;Although &lt;a href="https://laravel.com/docs/6.x/filesystem"&gt;Laravel Docs&lt;/a&gt; doesn't mention of Alibaba Cloud OSS, OSS compatibility with S3 API allows you to access it using the same API, without using any additional package or SDK. For information regarding S3 to OSS data migration, and compatible S3 APIs, refer to their &lt;a href="https://www.alibabacloud.com/help/doc-detail/64919.htm"&gt;documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Laravel Configuration
&lt;/h2&gt;

&lt;p&gt;To use OSS on Laravel, add the following into the &lt;code&gt;disks&lt;/code&gt; array in your &lt;code&gt;config/filesystems.php&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        'oss' =&amp;gt; [
            'driver' =&amp;gt; 's3',
            'key' =&amp;gt; env('OSS_ACCESS_KEY_ID'),
            'secret' =&amp;gt; env('OSS_SECRET_ACCESS_KEY'),
            'region' =&amp;gt; env('OSS_REGION'),
            'bucket' =&amp;gt; env('OSS_BUCKET'),
            'endpoint' =&amp;gt; env('OSS_ENDPOINT'),
            'url' =&amp;gt; env('OSS_URL'),
            'visibility' =&amp;gt; 'public', // Default visibility
        ],
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Add your &lt;a href="https://www.alibabacloud.com/help/doc-detail/53045.htm?spm=a2c63.p38356.879954.9.7cc76aec5GdeXP#concept-53045-zh"&gt;Access Key&lt;/a&gt; and bucket details for OSS in your &lt;code&gt;.env&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OSS_ACCESS_KEY_ID=EXAMPLE
OSS_SECRET_ACCESS_KEY=Example123
OSS_REGION=oss-ap-southeast-3
OSS_BUCKET=examplebucket
OSS_ENDPOINT=https://oss-ap-southeast-3.aliyuncs.com
OSS_URL=https://oss.example.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Simple as that! To make OSS your default filesystem disk, set &lt;code&gt;FILESYSTEM_DRIVER&lt;/code&gt; and &lt;code&gt;FILESYSTEM_CLOUD&lt;/code&gt; to &lt;code&gt;oss&lt;/code&gt; in &lt;code&gt;.env&lt;/code&gt;. You may also &lt;a href="https://www.alibabacloud.com/help/doc-detail/31902.htm"&gt;bind your own domain&lt;/a&gt; to the bucket to access objects through the domain URL.&lt;/p&gt;

</description>
      <category>alibabacloud</category>
      <category>objectstorage</category>
      <category>laravel</category>
      <category>s3</category>
    </item>
  </channel>
</rss>
