<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>laravel Archives | Clever Cloud</title>
	<atom:link href="https://www.clever.cloud/blog/tag/laravel/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.clever.cloud/blog/tag/laravel/</link>
	<description>From Code to Product</description>
	<lastBuildDate>Wed, 18 Oct 2017 17:15:00 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://cdn.clever-cloud.com/uploads/2023/03/cropped-cropped-favicon-32x32.png</url>
	<title>laravel Archives | Clever Cloud</title>
	<link>https://www.clever.cloud/blog/tag/laravel/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>One Framework a Day keeps the Boredom Away: Laravel</title>
		<link>https://www.clever.cloud/blog/features/2017/10/18/1fdba-laravel-polr/</link>
		
		<dc:creator><![CDATA[Laurent Doguin]]></dc:creator>
		<pubDate>Wed, 18 Oct 2017 17:15:00 +0000</pubDate>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[1fdba]]></category>
		<category><![CDATA[laravel]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://www2.cleverapps.io/wp/blog/technology/2017/10/18/1fdba-laravel-polr/</guid>

					<description><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/1fdba-laravel-1.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="1fdba laravel 1" decoding="async" fetchpriority="high" srcset="https://cdn.clever-cloud.com/uploads/2021/08/1fdba-laravel-1.png 1400w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-laravel-1-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-laravel-1-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-laravel-1-768x296.png 768w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-laravel-1-1368x528.png 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p><p>Welcome to this new edition of <a href="/blog/features/2017/10/09/1fdba-step0/">One Framework a Day keeps the Boredom Away</a>. In this series I will show you how to deploy a particular framework on Clever Cloud every day until I want to go back to boredom. Today it&#39;s about Laravel.</p>
<span id="more-2912"></span>

<p>In each post of this series we&#39;ll see how to deploy a particular framework on Clever Cloud. Today we are taking a look at <a href="https://laravel.com/">Laravel</a>.</p>
<p>If you want to tag along, make sure you have git, a Clever Cloud account and that you have installed our CLI <a href="https://github.com/CleverCloud/clever-tools">Clever-Tools</a>.</p>
<h2 id="what-is-laravel">What is Laravel?</h2>
<blockquote>
Laravel is a free, open-source PHP web framework, created by Taylor Otwell and intended for the development of web applications following the model–view–controller (MVC) architectural pattern.
</blockquote>

<p>To go a bit further the basics, I have deployed this URL shortener application called <a href="https://github.com/cydrobolt/polr">Polr</a>. It&#39;s actualy written with <a href="https://lumen.laravel.com/">Lumen</a>, a Laravel micro-framework.</p>
<h2 id="setup">Setup</h2>
<p>Here are the necessary steps to configure your Polr application:</p>
<ul>
<li>Clone the backend: <code>git clone https://github.com/cydrobolt/polr</code></li>
<li>Get in the project: <code>cd polr</code></li>
<li>Create the PHP application: <code>clever create --type php polr</code></li>
<li>Create the MySQL addon: <code>clever addon create mysql-addon --plan dev polr-mysql</code></li>
<li>Link the database to the application: <code>clever service link-addon polr-mysql</code></li>
<li>Add your domain: <code>clever domain add mypolr.cleverapps.io</code></li>
<li>Copy the default configuration: <code>cp .env.setup .env</code></li>
</ul>
<p>Then you need to setup the default webroot. We don&#39;t support environment variable for this yet, so you will have to create a <code>php.json</code> file under a <code>clevercloud</code> directory:</p>
<p><code>mkdir clevercloud</code> <code>vim clevercloud/php.json</code></p>
<pre><code class="language-json">{
  &quot;deploy&quot;: {
    &quot;webroot&quot;: &quot;/public&quot;
  }
}
</code></pre>
<p>Now commit all your changes, run <code>clever deploy</code> than <code>clever open</code>. You will be taken straight to the setup wizard of Polr. Go through all the steps, yes even the database configuration, because the setup will write ot the DB at the end. It will also overwrite <code>.env</code>. Problem is we use immutable infrastructure so all the changes written on that file will be lost at reboot. And reboot can happen for many reasons. Best way to manage this is to use <code>clever ssh</code> to log on the machine and copy the content of the now changed <code>.env</code> file to your own version of the file.</p>
<p>All the fields in this file can be remove and replaced by environment variables. You can also use pre-existing variables. In my case I have configured the database part like this:</p>
<pre><code class="language-bash">DB_HOST=$MYSQL_ADDON_HOST
DB_PORT=$MYSQL_ADDON_PORT
DB_DATABASE=$MYSQL_ADDON_DB
DB_USERNAME=$MYSQL_ADDON_USER
DB_PASSWORD=$MYSQL_ADDON_PASSWORD
</code></pre>
<p>Feel free to remove any fields you want to setup as an environment variable as they will be picked up automatically too.</p>
<p>The other option you have would have been to know exactly all the configuration variables needed, set them all, than ssh on the machine and use the <code>artisan</code> CLI to seed the database. Which is to me more cumbersome.</p>
<img src="https://www2.cleverapps.io/app/uploads/2021/08/MyPolr.png">

<p>Whatever solution you choose, take a look at their <a href="https://docs.polrproject.org/en/latest/user-guide/installation/">installation guide</a>. This will give you a good idea of all the things that are managed automatically by Clever Cloud :)</p>
]]></description>
										<content:encoded><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/1fdba-laravel-1.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="1fdba laravel 1" decoding="async" srcset="https://cdn.clever-cloud.com/uploads/2021/08/1fdba-laravel-1.png 1400w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-laravel-1-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-laravel-1-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-laravel-1-768x296.png 768w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-laravel-1-1368x528.png 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p><p>Welcome to this new edition of <a href="/blog/features/2017/10/09/1fdba-step0/">One Framework a Day keeps the Boredom Away</a>. In this series I will show you how to deploy a particular framework on Clever Cloud every day until I want to go back to boredom. Today it&#39;s about Laravel.</p>
<span id="more-2912"></span>

<p>In each post of this series we&#39;ll see how to deploy a particular framework on Clever Cloud. Today we are taking a look at <a href="https://laravel.com/">Laravel</a>.</p>
<p>If you want to tag along, make sure you have git, a Clever Cloud account and that you have installed our CLI <a href="https://github.com/CleverCloud/clever-tools">Clever-Tools</a>.</p>
<h2 id="what-is-laravel">What is Laravel?</h2>
<blockquote>
Laravel is a free, open-source PHP web framework, created by Taylor Otwell and intended for the development of web applications following the model–view–controller (MVC) architectural pattern.
</blockquote>

<p>To go a bit further the basics, I have deployed this URL shortener application called <a href="https://github.com/cydrobolt/polr">Polr</a>. It&#39;s actualy written with <a href="https://lumen.laravel.com/">Lumen</a>, a Laravel micro-framework.</p>
<h2 id="setup">Setup</h2>
<p>Here are the necessary steps to configure your Polr application:</p>
<ul>
<li>Clone the backend: <code>git clone https://github.com/cydrobolt/polr</code></li>
<li>Get in the project: <code>cd polr</code></li>
<li>Create the PHP application: <code>clever create --type php polr</code></li>
<li>Create the MySQL addon: <code>clever addon create mysql-addon --plan dev polr-mysql</code></li>
<li>Link the database to the application: <code>clever service link-addon polr-mysql</code></li>
<li>Add your domain: <code>clever domain add mypolr.cleverapps.io</code></li>
<li>Copy the default configuration: <code>cp .env.setup .env</code></li>
</ul>
<p>Then you need to setup the default webroot. We don&#39;t support environment variable for this yet, so you will have to create a <code>php.json</code> file under a <code>clevercloud</code> directory:</p>
<p><code>mkdir clevercloud</code> <code>vim clevercloud/php.json</code></p>
<pre><code class="language-json">{
  &quot;deploy&quot;: {
    &quot;webroot&quot;: &quot;/public&quot;
  }
}
</code></pre>
<p>Now commit all your changes, run <code>clever deploy</code> than <code>clever open</code>. You will be taken straight to the setup wizard of Polr. Go through all the steps, yes even the database configuration, because the setup will write ot the DB at the end. It will also overwrite <code>.env</code>. Problem is we use immutable infrastructure so all the changes written on that file will be lost at reboot. And reboot can happen for many reasons. Best way to manage this is to use <code>clever ssh</code> to log on the machine and copy the content of the now changed <code>.env</code> file to your own version of the file.</p>
<p>All the fields in this file can be remove and replaced by environment variables. You can also use pre-existing variables. In my case I have configured the database part like this:</p>
<pre><code class="language-bash">DB_HOST=$MYSQL_ADDON_HOST
DB_PORT=$MYSQL_ADDON_PORT
DB_DATABASE=$MYSQL_ADDON_DB
DB_USERNAME=$MYSQL_ADDON_USER
DB_PASSWORD=$MYSQL_ADDON_PASSWORD
</code></pre>
<p>Feel free to remove any fields you want to setup as an environment variable as they will be picked up automatically too.</p>
<p>The other option you have would have been to know exactly all the configuration variables needed, set them all, than ssh on the machine and use the <code>artisan</code> CLI to seed the database. Which is to me more cumbersome.</p>
<img src="https://www2.cleverapps.io/app/uploads/2021/08/MyPolr.png">

<p>Whatever solution you choose, take a look at their <a href="https://docs.polrproject.org/en/latest/user-guide/installation/">installation guide</a>. This will give you a good idea of all the things that are managed automatically by Clever Cloud :)</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
