<?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 Leonardo Henrique Steil on Medium]]></title>
        <description><![CDATA[Stories by Leonardo Henrique Steil on Medium]]></description>
        <link>https://medium.com/@leosteil?source=rss-bbeb378d0a22------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*IuqQcmFrLdoMKpDI</url>
            <title>Stories by Leonardo Henrique Steil on Medium</title>
            <link>https://medium.com/@leosteil?source=rss-bbeb378d0a22------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 16:21:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@leosteil/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[What AI Can't Teach You About Microservices (Even Though It Can Build Them For You)]]></title>
            <link>https://leosteil.medium.com/what-ai-cant-teach-you-about-microservices-even-though-it-can-build-them-for-you-36bce9d95dad?source=rss-bbeb378d0a22------2</link>
            <guid isPermaLink="false">https://medium.com/p/36bce9d95dad</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[career-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Leonardo Henrique Steil]]></dc:creator>
            <pubDate>Fri, 31 Jul 2026 15:05:51 GMT</pubDate>
            <atom:updated>2026-07-31T15:05:51.174Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uSIzxleUvR6t5JtZ-Y0tyQ.png" /></figure><h3>What AI Can’t Teach You About Microservices (Even Though It Can Build Them For You)</h3><p>Three years ago, learning a new piece of distributed systems architecture meant a predictable ritual: find the official docs, watch a four-hour course, spend a weekend fighting YAML indentation, and only then — maybe — get to the part where you actually think about the problem you set out to understand.</p><p>Last week, I described a Saga Choreography lab to an AI assistant in a couple of sentences — four Node.js services, Redpanda as the broker, OpenSearch for centralized logs — and had the entire thing running in Docker in under twenty minutes. Working code, four containers talking to each other over real events, no tutorial in sight.</p><p>If you stop the story there, it sounds like the “AI replaces the need to learn” narrative that’s been repeated to death. I don’t think that’s what happened. I think something more interesting happened, and it’s worth being precise about it, because the imprecision is what’s making a lot of developers — especially the ones past the fundamentals stage, trying to break into a new domain — anxious about whether learning still means anything.</p><h3>The old ritual wasn’t actually about the ritual</h3><p>Here’s the uncomfortable part: most of what that old ritual cost you — reading framework docs, writing Dockerfiles from scratch, debugging why your docker-compose.yml won&#39;t reach a healthy state — was never the <em>point</em>. It was overhead you paid to get to the point. Nobody&#39;s professional growth came from correctly indenting a YAML file. It came from the moments <em>after</em> the setup worked, when something broke in a way that forced you to understand <em>why</em> the architecture was shaped the way it was.</p><p>AI collapsed the overhead. It did not collapse the moments that mattered. And if you don’t know the difference, you’ll walk away from a session like mine having built nothing you actually understand — you’ll have a working demo and zero intuition, which is arguably worse than not having the demo at all, because it feels like progress.</p><h3>A concrete case: the lab that didn’t teach me what I expected</h3><p>The premise of my lab was simple on the surface: four services — Order, Payment, Inventory, Shipping — pass a saga through each other via events, no central orchestrator. I already understood the textbook trade-off going in: Choreography avoids the single point of failure of an orchestrator, at the cost of a dual-write problem (writing to your local database and publishing the event aren’t atomic).</p><p>That much I could’ve told you before touching a keyboard. It’s not where the learning was.</p><p>The learning showed up in the two hours <em>after</em> the AI-generated stack technically “worked.” Two real bugs surfaced, and neither was something you’d find by reading a blog post titled “Saga Pattern Explained”:</p><p>Bug one: OpenSearch 2.12+ silently refuses to start without OPENSEARCH_INITIAL_ADMIN_PASSWORD — even when you&#39;ve explicitly disabled the security plugin. The failure mode isn&#39;t obvious from the error message alone; you have to know that OpenSearch&#39;s security bootstrap runs <em>before</em> it reads your &quot;disable security&quot; flag.</p><p>Bug two, more interesting: Redpanda’s REST proxy (Pandaproxy) does not auto-create topics on produce, even with auto_create_topics_enabled=true set at the cluster level. My publishEvent() calls were returning HTTP 200 — a <em>success</em> status — while silently swallowing an UNKNOWN_TOPIC_OR_PARTITION error buried inside the response body:</p><pre>$ curl -w &quot;\nHTTP_STATUS:%{http_code}\n&quot; -X POST http://localhost:8082/topics/order.created \<br>  -H &quot;Content-Type: application/vnd.kafka.json.v2+json&quot; \<br>  -d &#39;{&quot;records&quot;:[{&quot;value&quot;:{&quot;hello&quot;:&quot;world&quot;}}]}&#39;<br><br>{&quot;offsets&quot;:[{&quot;partition&quot;:0,&quot;error_code&quot;:3,&quot;offset&quot;:-1}]}<br>HTTP_STATUS:200</pre><p>error_code: 3 is Kafka&#39;s UNKNOWN_TOPIC_OR_PARTITION — but it&#39;s nested inside a 200 response, not surfaced as an HTTP failure. My code was checking res.ok, which is exactly what every tutorial tells you to do, and res.ok was true. The event was gone. No exception, no retry, no log line. The order service reported success; the payment service never even knew an order had been created.</p><p>The fix wasn’t a config flag — I tried rpk cluster config set auto_create_topics_enabled true first, restarted the broker, and got the identical response. The actual fix was creating the topics explicitly before any service starts publishing:</p><pre>$ docker compose exec redpanda rpk topic create order.created payment.processed \<br>    payment.failed inventory.reserved shipping.scheduled<br><br>TOPIC               STATUS<br>order.created       OK<br>payment.processed   OK<br>...<br><br>$ curl -w &quot;\nHTTP_STATUS:%{http_code}\n&quot; -X POST http://localhost:8082/topics/order.created \<br>  -H &quot;Content-Type: application/vnd.kafka.json.v2+json&quot; \<br>  -d &#39;{&quot;records&quot;:[{&quot;value&quot;:{&quot;hello&quot;:&quot;world&quot;}}]}&#39;<br><br>{&quot;offsets&quot;:[{&quot;partition&quot;:0,&quot;offset&quot;:0}]}<br>HTTP_STATUS:200</pre><p>Same request, same status code, completely different meaning — the only way to tell them apart is knowing to look inside the body.</p><p>Neither of these is a “Saga Pattern” concept. They’re the unglamorous, infrastructure-specific failure modes that never make it into an architecture diagram — and they’re exactly the kind of thing that, in a real production incident, costs someone two hours instead of five minutes. Which, not coincidentally, is the exact question I’d already been asked in an interview: <em>a customer says they were charged but their order never confirmed — how do you investigate, and what would you build so the next incident takes five minutes instead of two hours?</em></p><p>AI didn’t hand me that debugging session pre-solved. It handed me a stack fast enough that I got to <em>have</em> that debugging session in the first place, instead of spending the same twenty minutes reading Pandaproxy’s docs cover to cover looking for a “getting started” example that happened to hit the same edge case.</p><h3>The actual shift: from “acquiring information” to “verifying and interrogating it”</h3><p>This is the part I think is genuinely new, not just faster. The old skill was <em>information retrieval</em>: can you find the right doc, the right Stack Overflow answer, the right course chapter. That skill is now close to worthless — not because information got harder to find, but because it got too easy to generate, including confidently wrong information.</p><p>The skill that replaced it is <em>verification and interrogation</em>. When the AI writes a consumer loop that polls a Kafka REST proxy, the question isn’t “does this run?” — it’s “what happens if this process dies between reading a message and committing the offset?”, “why does this design commit <em>after</em> the handler resolves rather than before?”, “what class of bug does that prevent, and what class of bug does it <em>not</em> prevent?” Those questions don’t get asked automatically. They get asked by someone who already has enough of a mental model to know where the interesting seams are — and that mental model still has to come from you.</p><p>I came into this lab with eight years of monolith experience in payments — 3D Secure, refund engines, acquirer integrations — and zero hands-on microservices production time. The thing that let me ask the right questions wasn’t the AI. It was a completely unrelated pattern I already had: in my day job, every synchronous HTTP call in a payment flow carries a correlation ID that lets me reconstruct the full trace in our logs later. The moment I recognized that a Saga’s trace_id is <em>the exact same concept</em>, just carried over an asynchronous transport instead of a header on a synchronous call, the whole architecture stopped being abstract. That recognition is not something you can prompt into existence. It comes from having done something adjacent for real, under pressure, enough times that the pattern is load-bearing in your head.</p><h3>So what does “studying” mean now?</h3><p>I’d put it like this: the ritual changed, the requirement didn’t.</p><ul><li>You no longer need to spend a weekend reading docs to get a working environment. You do still need to spend the time <em>after</em> it works, deliberately breaking it, to find out what “working” was actually hiding.</li><li>You no longer need to memorize API syntax. You do still need enough of a mental model to notice when a 200 status code is lying to you.</li><li>You no longer need a course to hand you a starting point. You do still need your own prior experience — even from a completely different stack — to know which questions are worth asking once you have one.</li></ul><p>The failure mode I’d watch for, especially if you’re mid-career and using AI to break into a new domain, isn’t “I used AI so I didn’t really learn it.” It’s quieter than that: it’s stopping the moment the demo runs, because the demo running <em>feels</em> like the finish line the old ritual used to require. It was never the finish line. It was always just the part that used to take longest to get through.</p><p>The two bugs in my lab took less time to fix than they would have taken to <em>read about</em> five years ago. But they’re the only two hours of the whole exercise I’d say I actually learned something in.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36bce9d95dad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hexagonal Architechure (Ports and Adapters) with PHP]]></title>
            <link>https://leosteil.medium.com/hexagonal-architechure-ports-and-adpters-with-php-95d3fdb94656?source=rss-bbeb378d0a22------2</link>
            <guid isPermaLink="false">https://medium.com/p/95d3fdb94656</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[hexagonal-architecture]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Leonardo Henrique Steil]]></dc:creator>
            <pubDate>Tue, 07 May 2024 17:38:21 GMT</pubDate>
            <atom:updated>2024-05-07T20:01:05.256Z</atom:updated>
            <content:encoded><![CDATA[<p>Since I started my studies about software architecture, I have seen a lot of content about Clean Architecture, Microservices Architecture and Domain Driven Design. Of course, this content is very important, but these architectures could be overengineering for small projects. So, the question is: Do I not need to think about architecture for simple projects? In my opinion, the answer is: You should always think about architecture because your application may grow, and likely will grow, requiring maintenance.</p><p>That’s where the Hexagonal Architecture comes into play, defining patterns for your application and also serving as an entry point for you to implement more robust designs in your application in the future.</p><p>The Hexagonal Architecture, described by Alistair Cockburn, can be a good solution for these cases. Cockburn describes an architecture that “allows an application to equally be driven by users, programs, automated tests, or batch scripts, and to be developed and tested in isolation from its eventual runtime devices and databases.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/0*S2FxTvDg1QkVBrjw.png" /><figcaption>Figure 1 — source: <a href="https://jmgarridopaz.github.io/content/hexagonalarchitecture">https://jmgarridopaz.github.io/content/hexagonalarchitecture</a></figcaption></figure><p>Why I believe that Hexagonal Architecture can be a good entry point for those seeking knowledge about software architecture? Cockburn defines “just” how the boundaries of your application with its drivers and resources should be, but does not provide a discipline on how you should organize the internal part of the application. With this, you can have an interesting separation within an application that is starting, and thus, evolve the application design over time.</p><p>The name “Hexagonal Architecture” can be a bit misleading, as it’s not directly related to the hexagon itself. Cockburn’s choice of this name was merely illustrative, representing the idea of “Ports and Adapters,” which divides the application between its drivers (such as user interfaces, tests, and APIs) and its resources (such as databases and SMTP servers). This approach facilitates the understanding and implementation of the architecture, making it an attractive choice for those looking to start exploring software design concepts.</p><p>Before we dive into the practical part, it’s definitely worth checking out <a href="https://alistair.cockburn.us/hexagonal-architecture/">Cockburn’s content</a> to gain a more comprehensive understanding of the architecture. This will help to solidify your understanding of the principles and concepts behind Hexagonal Architecture, better preparing you to apply this knowledge in practice.</p><p>Now, let’s dive into the practical part of a project.</p><p>The application we’re going to use as an example here will be a kind of list of movies the user has watched, along with a rating they can assign to the movie. The user’s movie catalog will consist of the name, the rating assigned, and the IMDb, which will be dynamically fetched.</p><p>Specific details of the business rule can be ignored. The idea here is to illustrate how the application will communicate with its drivers and resources.</p><pre>&lt;?php<br><br>declare(strict_types=1);<br><br>namespace HexagonalArch;<br><br>use HexagonalArch\Repository\WatchedMovie;<br>use HexagonalArch\Repository\WatchedMoviesRepository;<br><br>class WatchedMoviesCatalog<br>{<br>    public function __construct(<br>        private readonly WatchedMoviesRepository $repository,<br>        private readonly IMDBGateway $IMDBGateway<br>    ){}<br><br>    public function execute(Filters $filters): WatchedMoviesCatalogOutputCollection<br>    {<br>        $watchedMovies = $this-&gt;repository-&gt;getWatchedMovies($filters);<br>        $output = new WatchedMoviesCatalogOutputCollection();<br><br>        /* @var WatchedMovie $watchedMovie */<br>        foreach ($watchedMovies as $watchedMovie) {<br>            $imdb = $this-&gt;IMDBGateway-&gt;getImdb($watchedMovie-&gt;imdbId);<br>            $output-&gt;add(new WatchedMoviesCatalogOutput($watchedMovie-&gt;name, $watchedMovie-&gt;watchedAt, $imdb));<br>        }<br><br>        return $output;<br>    }<br>}</pre><p>The WatchedMoviesCatalog class is responsible for returning the catalog of movies watched by the user. Note that in the constructor, we have dependency inversion, which gives our application complete control over the resources we are using.</p><p>This dependency inversion allows us to use Test Patterns such as Stubs, Mocks, Spies, and Fakes in our tests. Below is a test case for the WatchedMoviesCatalog</p><pre>public function test(): void<br>{<br>    $repositoryStub = $this-&gt;createMock(WatchedMoviesRepository::class);<br>    $watchedMoviesCollection = new WatchedMoviesCollection();<br>    $watchedMoviesCollection-&gt;add(new WatchedMovie(&#39;Fast and Furious&#39;, &#39;2024-02-1&#39;, &#39;tt123456&#39;));<br>    $repositoryStub-&gt;expects($this-&gt;once())<br>        -&gt;method(&#39;getWatchedMovies&#39;)<br>        -&gt;willReturn($watchedMoviesCollection);<br><br>    $imdbGatewayStub = $this-&gt;createMock(IMDbGateway::class);<br>    $imdbGatewayStub-&gt;expects($this-&gt;once())<br>        -&gt;method(&#39;getImdb&#39;)<br>        -&gt;willReturn(7.4);<br>    $watchedMoviesCatalog = new WatchedMoviesCatalog($repositoryStub, $imdbGatewayStub);<br><br>    $catalog = $watchedMoviesCatalog-&gt;execute(new Filters());<br>    /** @var WatchedMoviesCatalogOutput $firstMovie */<br>    $firstMovie = $catalog-&gt;getIterator()[0];<br><br>    $this-&gt;assertEquals(&#39;Fast and Furious&#39;, $firstMovie-&gt;movieName);<br>    $this-&gt;assertEquals(&#39;2024-02-1&#39;, $firstMovie-&gt;watchedAt);<br>    $this-&gt;assertEquals(7.4, $firstMovie-&gt;imdbRate);<br>}</pre><p>Imagine a scenario where our dependency control flow is not inverted. Perhaps it would be impossible to test the result of IMDB, as this can be a variable value. Considering this, controlling our resources allows us to have more robust, independent, and repeatable tests.</p><p>In the example above, we have a driver (test case) consuming our application. Other drivers, such as APIs, messaging systems, or even CLI, could also consume our application.</p><p>Some other less important information:</p><p>As this is an example application, I did not use any dependency injection service to control our dependency inversion.</p><p>We could easily add an HTTP layer using a microframework like SLIM.</p><p>To have more control over the returns of application methods that returned arrays, I used the concept of First Class Collections.</p><p>You can find the application code on my GitHub: <a href="https://github.com/leosteil/hexagonal-arch-php">https://github.com/leosteil/hexagonal-arch-php</a>. This project will be continuously improved, with the addition of new business rules, the incorporation of a framework for API creation, among other enhancements.</p><p>Sources:</p><ul><li><a href="https://alistair.cockburn.us/hexagonal-architecture/">Hexagonal architecture</a></li><li><a href="https://jmgarridopaz.github.io/content/hexagonalarchitecture">Hexagonal Architecture - Ports ans Adapters Pattern</a></li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FAOIWUPjal60&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DAOIWUPjal60&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2FAOIWUPjal60%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ec3c079dcb700ddf7749ab305ed6e031/href">https://medium.com/media/ec3c079dcb700ddf7749ab305ed6e031/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95d3fdb94656" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Laravel com MinIO: uma solução para o S3 em ambiente de desenvolvimento]]></title>
            <link>https://leosteil.medium.com/laravel-com-minio-uma-solu%C3%A7%C3%A3o-para-o-s3-em-ambiente-de-desenvolvimento-8696e65d169a?source=rss-bbeb378d0a22------2</link>
            <guid isPermaLink="false">https://medium.com/p/8696e65d169a</guid>
            <category><![CDATA[minio]]></category>
            <category><![CDATA[laravel]]></category>
            <dc:creator><![CDATA[Leonardo Henrique Steil]]></dc:creator>
            <pubDate>Mon, 02 Aug 2021 16:57:50 GMT</pubDate>
            <atom:updated>2021-08-04T23:27:06.663Z</atom:updated>
            <content:encoded><![CDATA[<p>Fala pessoal, beleza?</p><p>Estou desenvolvendo uma aplicação utilizando o framework <a href="https://laravel.com/"><strong>Laravel</strong></a> onde surgiu a necessidade de fazer o upload de arquivos. Como o deploy da aplicação seria em um ambiente na AWS, o armazenamento dos arquivos, por conveniência será no Amazon S3.</p><p>Com isso, pensei em criar um bucket que seria utilizado no ambiente de desenvolvimento, mas pensando no longo prazo, essa não é uma alternativa muito viável. Então, lendo a documentação do Laravel conheci o MinIO.</p><p>O <a href="https://min.io/"><strong>MinIO</strong></a> é um serviço open-source de Object Store compatível com o <a href="https://aws.amazon.com/pt/s3/">Amazon S3</a>. Com ele podemos simular localmente o S3, utilizando o File Storage do Laravel da mesma forma que seria utilizado em um ambiente de produção.</p><p>Neste artigo não vou me aprofundar na instalação do MinIO. Para quem utiliza Docker no ambiente de desenvolvimento, o MinIO pode ser inserido no docker-compose. Atualmente o Laravel conta com o<a href="https://laravel.com/docs/8.x/sail"> Laravel Sail</a>, que é muito útil pra quem quer utitilizar o Docker. Também é possível utilizá-lo junto com a instalação do Laravel via <a href="https://laravel.com/docs/8.x/homestead">Homestead</a>. Bem como instalá-lo de forma direta na sua máquina. Abaixo segue a instalação do MinIO utilizando-se o Laravel Sail para uma nova aplicação:</p><pre>curl -s &quot;https://laravel.build/example-app?with=minio&quot; | bash</pre><p>Para maiores informações sobre os serviços oferecidos pelo Sail é possível consultar os links: <a href="https://laravel.com/docs/8.x/installation#choosing-your-sail-services">https://laravel.com/docs/8.x/installation#choosing-your-sail-services</a> e <a href="https://laravel.com/docs/8.x/sail">https://laravel.com/docs/8.x/sail</a></p><p>O primeiro passo após a instalação é inserir as credencias utilizadas pelo MinIO dentro do .env. Essas informações podem ser encontradas em <a href="https://laravel.com/docs/8.x/sail#file-storage">https://laravel.com/docs/8.x/sail#file-storage</a>.</p><pre>FILESYSTEM_DRIVER=s3<br>AWS_ACCESS_KEY_ID=sail<br>AWS_SECRET_ACCESS_KEY=password<br>AWS_DEFAULT_REGION=us-east-1<br>AWS_BUCKET=local<br>AWS_ENDPOINT=<a href="http://minio:9000/">http://minio:9000</a><br>AWS_URL=<a href="http://localhost:9000/local">http://localhost:9000</a>/local<br>AWS_USE_PATH_STYLE_ENDPOINT=true</pre><p>Além das informações presentes nas documentações do Laravel, precisei buscar mais na web sobre como fazer a ferramenta funcionar no meu ambiente local. Não existem muitas informações sobre, então precisei experimentar algumas configurações e cheguei no que está descrito acima.</p><p>Na variavel AWS_URL, precisei colocar o bucket no final. Por algum motivo que ainda não descobri, quando estou buscando informações, a variável AWS_BUCKET está sendo ignorada. A variável AWS_URL é utilizada na comunicação entre o localhost e o serviço do MinIO. Já a AWS_ENDPOINT, é utilizada pelo container do PHP para comunicação com o container do MinIO.</p><p><strong>Atenção: 1. </strong>se instalado pelo Laravel Sail, a porta para acessar o MinIO será a 9000, porém isso pode variar de acordo com sua instalação. 2<strong>. </strong>é importante salientar que essa configuração básica pode variar um pouco de acordo com a instalação do MinIO.</p><p>Com isso configurado, então teremos acesso a plataforma através <a href="http://localhost:9000/minio/">http://localhost:9000/minio/</a>. Abaixo temos duas imagens da plataforma.</p><figure><img alt="MinIO: página de login" src="https://cdn-images-1.medium.com/max/1024/1*ot2eOVWGNZgisSdEgQj4Vg.png" /><figcaption>Tela de login do MinIO</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bKEQtSG0MhIIBrQTmUfr0w.png" /><figcaption>Tela Inicial do MinIO</figcaption></figure><p>Na tela inicial, no botão da parte baixa da direita, você deve criar um um bucket com o mesmo nome do valor da config <strong><em>AWS_BUCKET.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HrKXHn8T40EDXd5eqgwgEw.png" /><figcaption>Bucket local criado</figcaption></figure><p>O MinIO permite realizar o permissionamento da mesma forma que o AWS S3. Porém, para fins práticos e de estudo, vamos liberar a leitura e escrita para todos os usuários. Para isso, ao passar o mouse em cima do bucket irá surgir um ícone com três pontinhos. Clique ali e depois em <em>Edit Policy. Em seguida na tela abaixo, utilize * no prefix e Read and Write ao lado.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*r2mrRMEotXEfBvM9LN5f1Q.png" /></figure><p>Agora vamos para a parte prática, onde demonstrarei em uma aplicação simples o uso do MinIO. Serão dois endpoints, um para fazer o upload e outro para exibir os arquivos que foram armazenados. Vamos restringir o upload apenas a imagens, apenas para facilitar o manuseio das informações. Os layouts utilizados na aplicação podem ser encontrados aqui: <a href="https://codepen.io/gaitho/pen/mjBBLP">https://codepen.io/aaroniker/pen/jjZGLG</a></p><p>Bora começar com o upload:</p><pre>Route::get(&#39;/upload_images&#39;, function () {<br>    return view(&#39;upload-image&#39;);<br>});</pre><pre>Route::post(<br>    &#39;/upload_files&#39;,<br>    [UploadFileController::class, &#39;uploadImages&#39;]<br>);</pre><p>Os métodos do <em>controller</em> <strong>UploadFileController</strong> são bem simples. O método uploadImages possui um validador para garantir a entrada apenas de imagens e após a validação, o mesmo insere as imagens na raiz do bucket local. O método <strong>showUploadedImages </strong>é responsável por trazer as urls das imagens que foram salvas.</p><pre>&lt;?php</pre><pre>namespace App\Http\Controllers;</pre><pre>use App\Http\Controllers\Controller;<br>use Illuminate\Http\Request;<br>use Illuminate\Support\Facades\Storage;</pre><pre>class UploadFileController extends Controller<br>{<br>    public function uploadImages(Request $request)<br>    {<br>        $request-&gt;validate([<br>            &#39;file&#39; =&gt; &#39;required|image&#39;,<br>        ]);</pre><pre>        $request-&gt;file-&gt;store(&#39;.&#39;);<br>   <br>        return view(&#39;upload-image&#39;);<br>    }</pre><pre>    public function showUploadedImages(Request $request)<br>    {<br>        $imagesUrl = Storage::disk(&#39;s3&#39;)-&gt;allFiles(&#39;&#39;);</pre><pre>        return view(&#39;images&#39;, compact(&#39;imagesUrl&#39;));<br>    }<br>}</pre><p>Além destas rotas, outra foi criada para chamar uma action utilizada para exibir as imagens salvas.</p><pre>Route::get(<br>    &#39;/images&#39;,<br>    [UploadFileController::class, &#39;showUploadedImages&#39;]<br>);</pre><p>Repositório no GitHub da aplicação: <a href="https://github.com/leosteil/laravel-minio-tutorial">https://github.com/leosteil/laravel-minio-tutorial</a></p><p>Deixei no Readme, uma explicação de como vocês podem fazer para executar o projeto caso tenham interesse.</p><p>Estou totalmente aberto a tentar ajudar vocês com dúvidas e a receber feedbacks sobre o material.</p><p>Obrigado pela leitura!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8696e65d169a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>