<?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>Culttt &#187; Philip Brown</title>
	<atom:link href="http://culttt.com/author/philipbrown/feed/" rel="self" type="application/rss+xml" />
	<link>http://culttt.com</link>
	<description>Articles on business, technology and the Internet</description>
	<lastBuildDate>Fri, 17 May 2013 07:25:54 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Design Inspiration #85</title>
		<link>http://culttt.com/2013/05/17/design-inspiration-85/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=design-inspiration-85</link>
		<comments>http://culttt.com/2013/05/17/design-inspiration-85/#comments</comments>
		<pubDate>Fri, 17 May 2013 07:20:44 +0000</pubDate>
		<dc:creator>Philip Brown</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://culttt.com/?p=3120</guid>
		<description><![CDATA[<p>Design Inspiration from Sipp, Playground Inc, Involvio, Mariusz Cieśla and Starmatic! Design Inspiration is a weekly post that showcases examples of some of the best new web design from around the internet. To submit to Design Inspiration, click the “submit” link at the bottom of the page and follow the instructions for submitting your site [...]</p><p><a href="http://culttt.com/2013/05/17/design-inspiration-85/">Design Inspiration #85</a> was written by <a rel="author" href="http://culttt.com/author/philipbrown/">Philip Brown</a> on <a href="http://culttt.com">Culttt - Articles on business, technology and the Internet</a></p>]]></description>
				<content:encoded><![CDATA[<p>Design Inspiration from Sipp, Playground Inc, Involvio, Mariusz Cieśla and Starmatic!</p>
<p>Design Inspiration is a weekly post that showcases examples of some of the best new web design from around the internet. To submit to Design Inspiration, click the “submit” link at the bottom of the page and follow the instructions for submitting your site or a site you wish to feature.</p>
<p><a href="http://sipp.cc/"><img src="http://culttt.com/wp-content/uploads/2013/05/Sipp.jpg" alt="Sipp" /></a></p>
<h2>Sipp</h2>
<p><a href="http://sipp.cc/">http://sipp.cc</a></p>
<p><a href="http://playgroundinc.com/"><img src="http://culttt.com/wp-content/uploads/2013/05/Playground-Inc.jpg" alt="Playground Inc" /></a></p>
<h2>Playground Inc</h2>
<p><a href="http://playgroundinc.com/">http://playgroundinc.com</a></p>
<p><a href="http://www.involvio.com/"><img src="http://culttt.com/wp-content/uploads/2013/05/Involvio.jpg" alt="Involvio" /></a></p>
<h2>Involvio</h2>
<p><a href="http://www.involvio.com/">http://www.involvio.com</a></p>
<p><a href="http://mariusz.cc/"><img src="http://culttt.com/wp-content/uploads/2013/05/Mariusz-Ciesla.jpg" alt="Mariusz Ciesla" /></a></p>
<h2>Mariusz Cieśla</h2>
<p><a href="http://mariusz.cc/">http://mariusz.cc</a></p>
<p><a href="http://starmatic.com/"><img src="http://culttt.com/wp-content/uploads/2013/05/Starmatic.jpg" alt="Starmatic" /></a></p>
<h2>Starmatic</h2>
<p><a href="http://starmatic.com/">http://starmatic.com</a></p>
<p><a href="http://culttt.com/2013/05/17/design-inspiration-85/">Design Inspiration #85</a> was written by <a rel="author" href="http://culttt.com/author/philipbrown/">Philip Brown</a> on <a href="http://culttt.com">Culttt - Articles on business, technology and the Internet</a></p>]]></content:encoded>
			<wfw:commentRss>http://culttt.com/2013/05/17/design-inspiration-85/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Long Tail [Review]</title>
		<link>http://culttt.com/2013/05/15/the-long-tail-review/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-long-tail-review</link>
		<comments>http://culttt.com/2013/05/15/the-long-tail-review/#comments</comments>
		<pubDate>Wed, 15 May 2013 07:30:26 +0000</pubDate>
		<dc:creator>Philip Brown</dc:creator>
				<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://culttt.com/?p=3108</guid>
		<description><![CDATA[<p>For the last 100 hundred years, our culture has been obsessed with the big hits, the top selling songs and the highest grossing films. But in the last 15 years, despite the world&#8217;s population growing, these hits aren&#8217;t increasing in numbers. The Internet has now opened the door to a proliferation of on demand content. [...]</p><p><a href="http://culttt.com/2013/05/15/the-long-tail-review/">The Long Tail [Review]</a> was written by <a rel="author" href="http://culttt.com/author/philipbrown/">Philip Brown</a> on <a href="http://culttt.com">Culttt - Articles on business, technology and the Internet</a></p>]]></description>
				<content:encoded><![CDATA[<p><img src="http://culttt.com/wp-content/uploads/2013/05/The-Long-Tail-Review.jpg" alt="The Long Tail Review" /><br />
For the last 100 hundred years, our culture has been obsessed with the big hits, the top selling songs and the highest grossing films. But in the last 15 years, despite the world&#8217;s population growing, these hits aren&#8217;t increasing in numbers.</p>
<p>The Internet has now opened the door to a proliferation of on demand content. It is now relatively easy to get access to media from any number of content niches. Unlimited distribution has completely revolutionised the economics of &#8220;the hit business&#8221; as the long tail of consumption has grown.</p>
<p><em>The Long Tail</em> is a book of research on how the Internet has augmented the fragmentation of the media we consume. Where the economies of distribution are close to zero, there is no reason not to offer every possible piece of content. The Internet has also enabled amateur work and professional work to sit side by side and compete for the same audience. Consumers don&#8217;t choose something based on if it&#8217;s a hit, they now choose based on their unique tastes and interests.</p>
<p>The Long Tail is written by former Wired Editor-In-Chief <a href="http://en.wikipedia.org/wiki/Chris_Anderson_(writer)">Chris Anderson</a>. Chris gathered research from some of the largest online companies who have taken advantage of this opportunity such as Amazon, eBay and Apple&#8217;s iTunes. Chris first discovered the economies of the long tail when he found that 98 percent of all online products will be requested within a given period of time. This rule relates to books on Amazon, products on eBay and songs on iTunes. <a href="http://en.wikipedia.org/wiki/Pareto_principle">Pareto&#8217;s 80/20 principal</a> declares that 80 percent of the revenue will come from 20 percent of the products and so Chris realised that this was a huge shift in the economies of modern business.</p>
<p>The death of the hit based business can be seen in continually failing of the high street. A music store like <a href="http://www.hmv.co.uk/">HMV</a> can only supply the top selling products in a physical location because each item takes up shelf space. HMV relies on being able to turn over inventory and so only the top sellers can be included because a top seller and a item that sells only once both take up the same amount of space. But now that the Internet has broadened our taste, consumers want a much greater depth of choice. iTunes and Amazon have unlimited shelf space and the economies of scale and online distribution mean that delivering that item to the consumer is an order of magnitude cheaper.</p>
<h2>A mass of niches</h2>
<p>Now that access to content is not controlled by gatekeepers, and supply and demand can follow a new curve of adoption, consumers are discovering that their taste is not so mainstream after all. The Internet has destroyed the old distribution paradigm and democratised content consumption. It is now possible to find all types of content on the Internet that appeal to a very fragmented set of interests.</p>
<p>The Internet has also created the opportunity for anyone to create and produce high quality content and deliver it to an audience. The rise of the YouTube star has in many ways replaced the old television star and many new mainstream personalities first grow their audience online.</p>
<h2>The three forces of the Long Tail</h2>
<p>The Long Tail has only recently become possible over the last 15 years because of three evolutions in technology. These three evolutions form the three forces of the Long Tail.</p>
<h3>The democratisation of the tools of production</h3>
<p>The widespread adoption of PCs over the last couple of decades has put the power of production into the consumer&#8217;s hand. At one time, only professionals could produce video, music or publish to the Internet because it was beyond the average consumer. Now many PCs come preinstalled with everything you need to get going producing your own content.</p>
<p>Secondly, the widespread adoption of smartphones has spread this democratisation even further. Smartphones need to be much simpler to use than PCs but they are increasingly catching up in power. Smartphones also come with all the necessary components to become a content producer. When all you need is a camera, simple editing software and a connection to the Internet, the smartphone revolution has made us all into content producers.</p>
<h3>The democratisation of the tools of distribution</h3>
<p>Distribution is critical to becoming a successful content producer. At one time, distribution was tightly controlled by music producers, television networks and physical publishers. However, the Internet has completely changed how we consume content.</p>
<p>When distribution was tightly controlled, the gatekeepers told us what we should like through the hit machine. With the Internet, you can explore your own path of interests, taking a deep dive in areas that were previously totally inaccessible.</p>
<p>Now that it&#8217;s possible to explore the long tail, the head is increasingly becoming less relevant as more and more consumers move down the tail.</p>
<h3>The connection of supply and demand</h3>
<p>The companies that have been early to recognise and adopt the long tail have been instrumental in enabling the third force. With so much content, and so many possible niches to explore, consumers need some way of organising the mass.</p>
<p>Google indexes and ranks the billions of websites across the Internet based on the signals that it picks up from the website and from it&#8217;s users. Netflix orders it&#8217;s films based upon how previously users have enjoyed the content. Amazon is able to make recommendations to users based on millions of transactions on a daily basis.</p>
<p>Now that we aren&#8217;t being told what to like, there is a huge opportunity to become a curator and to help consumers find where their true passions lie.</p>
<h2>Scarcity and Abundance</h2>
<p>One of the definitions of <b>economics</b> is <em>&#8220;The social science of choice under scarcity&#8221;</em> and another is <em>&#8220;The allocation of scarce resources to satisfy unlimited wants&#8221;</em>. In the age of the long tail, scarcity has been turned on it&#8217;s head.</p>
<p>Box office sales in the film industry are the leading indicator of a &#8220;successful&#8221; film. The first couple of films in this chart will have returned the majority of the revenues for the industry. As you go down the chart, there is a sharp drop off at around the 500th film. This is not because there are only 500 films being created in any given year, but it is because the distribution of feature films only allow 500 films to be seen at physical locations. In reality, there are tens of thousand of feature films being created each year, but due to them not being able to get mainstream distribution, it&#8217;s as if they didn&#8217;t exist at all.</p>
<p>Video streaming services like Netflix completely change this distribution problem. Netflix can hold and distribute an unlimited amount of content to it&#8217;s audience. It&#8217;s now possible to consume any of the thousands of feature films that are produced each year if they are available on the internet.</p>
<p>It is this effect, and the similar effects in adjacent industries like music and publishing that are turning scarcity on it&#8217;s head.</p>
<p>Of course we still have the scarcity of time and attention. Just because we now have access to more content and more niche interests, does not necessarily mean we will invest more time or money consuming that content. Having the choice of 10 channels or 1000 channels won&#8217;t guarantee more consumption, rather the consumption will just be more suited to the individual.</p>
<p>The long tail does have a dramatic effect on potential revenues. Brick and mortar retailers face the cut throat world of the hit machine, managing inventory and supplying demand. In online retailing, where the cost of holding inventory and distribution is constantly falling towards zero, the opportunity for greater margins can often be found in the niche products that did not even exist to the traditional retailers.</p>
<h2>The paradox of choice</h2>
<p>In a study that was conducted to measure how we as consumers value choice, it was found that the more choice someone has, the less likely they were to make a purchase. The study measured the number of available jams, and the likelihood that a purchase would be made. When there were 6 jams, 30% of consumers made a purchase. When there were 24 jams, just 3% of consumers made a purchase. The study suggests that choice becomes a deliberating factor when humans become overwhelmed with variety.</p>
<p>However, this is clearly not the case when you walk down any supermarket aisle. Over the last 50 years, the number of products in any given category has exploded. It&#8217;s now possible to purchase a wide range of spaghetti sauces, breakfast cereals or type of biscuit. This would seem to fly in the face of that original study.</p>
<p>This kind of fragmentation is not limited to just physical products or types of food. Just about everything in our lives has become increasingly fragmented over the last couple of decades. At one time, everyone read the same newspapers, watched the same television shows and bought the same products. However, as manufacturing, production and distribution costs have dramatically fallen, the amount of choice through fragmentation has exploded.</p>
<p>It turns out that consumers actually value choice extremely highly. When there is an abundance of choice, the consumer feels more satisfied that they made the right choice for their specific tastes. In order to help the consumer sort through the choice to find exactly what they want, the producer needs to sort and organise their products in to a logical taxonomy so that the consumer can construct a method of selection.</p>
<p>The authors of the original study later released a follow up that showed that consumers feel overwhelmed by the abundance of choice when the choices are not ordered logically.</p>
<h2>The infinite screen</h2>
<p>An area of media consumption that has been dramatically effected by the long tail is television, video and film. Mass media television has grown substantially over the last 50 years as there are now more available channels to the average consumer than there has ever been. However that availability is just a small slice of what is available on the Internet every single day.</p>
<p>YouTube has been a great enabler of this shift. When you look at any individual video on YouTube, it is far more likely to be of much lower quality than anything that has made it on to TV. But the mass of content also produces highly targeted and relevant content for the new age of consumers.</p>
<p>Traditional television has channels dedicated to History, Golf or Home improvement. However, consumer&#8217;s interests are much more fragmented than these options. Once you start walking down the path of a niche, you will find that it just doesn&#8217;t stop. On YouTube, a producer can create video content on any particular micro niche and publish it to the Internet fairly easily.</p>
<p>As more people transition their viewing from the mass of scheduled programming, and start exploring their individual interests online, those of us who become producers will have a greater opportunity to find a niche, an audience and a tribe who share our interests.</p>
<h2>Conclusion</h2>
<p>The Long Tail charts the dramatic shift from a hit mainstream economy to a fragmented niche economy. The Internet has powered much of this shift, but it can also be seen in just about any other industry that benefits from the falling costs of distribution and the wide array of new choice.</p>
<p>The shift from mainstream to fragmented niches is extremely important. Incumbent industries like television, Hollywood and publishing are struggling to understand this shift and how it effects their business. Consumers aren&#8217;t willing to be told what to like anymore and no amount of marketing can save a poor product.</p>
<p>Physical retailers are also suffering from the effects of the Long Tail. When Amazon can offer any product at a lower price, physical retailers need to stop fighting on price and instead move towards the opportunity that physical retailing affords.</p>
<p>One of the biggest effects of the Long Tail is the opportunity it has created for producers. It&#8217;s now very cheap to become a producer online. Without the traditional gatekeepers of just a few years ago, many people are finding an audience through YouTube, their blogs or through social media. As more and more consumers start exploring their niche interests online, this opportunity is only going to get bigger.</p>
<p>Buy <a href="http://www.amazon.com/gp/product/B001Q9E9F6/ref=as_li_ss_tl?ie=UTF8&#038;camp=1789&#038;creative=390957&#038;creativeASIN=B001Q9E9F6&#038;linkCode=as2&#038;tag=culttt-20">The Long Tail</a> on Amazon (Affiliate link)</p>
<p><a href="http://culttt.com/2013/05/15/the-long-tail-review/">The Long Tail [Review]</a> was written by <a rel="author" href="http://culttt.com/author/philipbrown/">Philip Brown</a> on <a href="http://culttt.com">Culttt - Articles on business, technology and the Internet</a></p>]]></content:encoded>
			<wfw:commentRss>http://culttt.com/2013/05/15/the-long-tail-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up your first Laravel 4 Model</title>
		<link>http://culttt.com/2013/05/13/setting-up-your-first-laravel-4-model/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setting-up-your-first-laravel-4-model</link>
		<comments>http://culttt.com/2013/05/13/setting-up-your-first-laravel-4-model/#comments</comments>
		<pubDate>Mon, 13 May 2013 07:29:20 +0000</pubDate>
		<dc:creator>Philip Brown</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Cribbb]]></category>
		<category><![CDATA[Laravel]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://culttt.com/?p=3104</guid>
		<description><![CDATA[<p>Model-View-Controller (MVC) is a very common design pattern in modern web applications. The wide usage and acceptance of the design pattern means that many of the most popular web frameworks are built around this architecture. Laravel 4 is one such framework that uses the MVC design pattern to cleanly separate the various aspects of a [...]</p><p><a href="http://culttt.com/2013/05/13/setting-up-your-first-laravel-4-model/">Setting up your first Laravel 4 Model</a> was written by <a rel="author" href="http://culttt.com/author/philipbrown/">Philip Brown</a> on <a href="http://culttt.com">Culttt - Articles on business, technology and the Internet</a></p>]]></description>
				<content:encoded><![CDATA[<p><img src="http://culttt.com/wp-content/uploads/2013/05/Setting-up-your-first-Laravel-4-Model.jpg" alt="Setting up your first Laravel 4 Model" /><br />
<a href="http://culttt.com/2012/11/19/what-is-mvc-model-view-controller/">Model-View-Controller (MVC)</a> is a very common design pattern in modern web applications. The wide usage and acceptance of the design pattern means that many of the most popular web frameworks are built around this architecture.</p>
<p>Laravel 4 is one such framework that uses the MVC design pattern to cleanly separate the various aspects of a web application.</p>
<p>In this post we&#8217;re going to look at what exactly is a Model, what are the three crucial components of Business Logic, and how to set up your first Model in Laravel 4.</p>
<h2>What is a Model</h2>
<p>So what exactly is a Model? If we&#8217;re going to be building this entire application on Models, first we need to understand exactly what they are.</p>
<p>A Model should contain all of the <a href="http://en.wikipedia.org/wiki/Business_logic">Business Logic</a> of your application. Or in other words, how the application interacts with the database.</p>
<p>Business Logic is essentially:</p>
<ol>
<li>The real world objects that appear in your application</li>
<li>How those objects interact with each other</li>
<li>A set of rules for how those objects are accessed and updated</li>
</ol>
<p>So for example, Users will be an important object within Cribbb because it is a social application.</p>
<ol>
<li>We need to store details of our users and so we need a User Model and a User table in the database.</li>
<li>Users will be required to enter a username, email address and password as well as other profile details. In order to ensure they enter correctly formatted data, we need to validate their input.</li>
<li>Users will be able to create Posts. So a User can have many posts, and each Post should belong to a User.</li>
</ol>
<p>So as you can see, that is basically how Models work in MVC applications. Essentially each important thing in the application will probably need a Model. You will probably need to validate the data that is used in your Models, and any logic that relates Models to one another should be dealt with here.</p>
<h2>Creating the User model</h2>
<p>User authentication is a requirement in just about every modern web application. Instead of forcing you to write your own User Model, Laravel 4 actually comes with a User Model straight out of the box.</p>
<p>So if you go into the <code>app/models</code> directory, you should find the <code>User.php</code> file. All of your models should go into this folder and they should be named following the same convention. So say for example, you had a Model for Posts in your application, the Model file would be <code>app/models/Post.php</code>.</p>
<p>As a side note, you don&#8217;t have to follow this convention, there are ways around it, but I really don&#8217;t know why you would.</p>
<p>Anyway, if you open up the User model, you will see a fairly basic Model boilerplate.</p>
<h2>Anatomy of a Laravel Model</h2>
<p>So as I mentioned above, every Model should represent a table in the database. In order to interact with the database, we will need to extend the Model from <code>Eloquent</code>. <em>Eloquent</em> is an <a href="http://en.wikipedia.org/wiki/Active_record_pattern">ActiveRecord implementation</a> that comes with Laravel.</p>
<p>Each Model extends Eloquent and so it inherits all of Eloquent&#8217;s methods for interacting with the database:</p>
<pre class="brush: php; title: ; notranslate">
class User extends Eloquent {}
</pre>
<p>You will also notice that the default User Model implements two interfaces:</p>
<pre class="brush: php; title: ; notranslate">
implements UserInterface, RemindableInterface
</pre>
<p>I&#8217;m not going to cover interfaces or the remindable features that are built into Laravel&#8217;s User model today as I will talk about them more extensively in a later tutorial.</p>
<p>The next thing you will notice is the protected property <code>$table</code>:</p>
<pre class="brush: php; title: ; notranslate">
/**
 * The database table used by the model.
 *
 * @var string
 */
protected $table = 'users';
</pre>
<p>As you can probably guess, this is simply declaring the name of the table that this model refers to. By default you don&#8217;t need to set this property as Laravel follows the <a href="http://en.wikipedia.org/wiki/Convention_over_configuration">convention of configuration</a> mantra. This basically means, if you call your model <em>User</em>, then Laravel will assume that your table name is <em>users</em>. Setting the <code>$table</code> property is useful when you want to give a table a name that does not follow this convention.</p>
<p>The <code>$hidden</code> property allows you to hide certain columns when returning an instance of the Model:</p>
<pre class="brush: php; title: ; notranslate">
/**
 * The attributes excluded from the model's JSON form.
 *
 * @var array
 */
protected $hidden = array('password');
</pre>
<p>This is simply an array of column names. This is useful when you want to return details of the user over a JSON API for example. You wouldn&#8217;t want to display the user&#8217;s password.</p>
<p>Next we need to protect against mass assignment. When you pass an array of data to the Model, the data is automatically <em>mass assigned</em> to the right columns. This is handy because it makes things a lot easier, but it also presents quite a serious security concern. For example, you wouldn&#8217;t want the a user to be able to change their user id as this should set automatically when the user is created and it should never change.</p>
<p>To protect against mass assignment, we need to specify which of the columns can be mass assigned. To do this, we need to set the <code>$fillable</code> property.</p>
<pre class="brush: php; title: ; notranslate">
protected $fillable = array('username', 'email');
</pre>
<p>This ensures only these fields can be mass assigned.</p>
<p>You can also set the <code>$guarded</code> property which <em>prevents</em> the listed columns from mass assignment. For example:</p>
<pre class="brush: php; title: ; notranslate">
protected $guarded = array('id', 'password');
</pre>
<p>And finally, the model comes with three simple methods for returning specific data items from the Model:</p>
<pre class="brush: php; title: ; notranslate">
/**
 * Get the unique identifier for the user.
 *
 * @return mixed
 */
public function getAuthIdentifier()
{
  return $this-&gt;getKey();
}

/**
 * Get the password for the user.
 *
 * @return string
 */
public function getAuthPassword()
{
  return $this-&gt;password;
}

/**
 * Get the e-mail address where password reminders are sent.
 *
 * @return string
 */
public function getReminderEmail()
{
  return $this-&gt;email;
}
</pre>
<h2>Validating in your Model</h2>
<p>All good applications require validating data at some point. Users are prone to make mistakes or enter incorrect data, and so you need to ensure that you enforce that only correct data is allowed to enter your system.</p>
<p>Laravel 4 comes with a fantastic <a href="http://four.laravel.com/docs/validation">Validation</a> package that makes creating and enforcing validation rules incredibly easy.</p>
<p>However, Laravel 4 does not enforce that you put your validation in your Models. A common bad practice is to place validation in the controller. This is bad because you are more than likely going to have to repeat that validation in multiple places throughout your application.</p>
<p>A much better place for your Validation is inside your Model because all interactions with the database must go through the Model, and so you will only need to write your rules once.</p>
<p>Due to Laravel 4 not enforcing where you put your Validation logic, I&#8217;m going to use an excellent package called <a href="https://github.com/laravelbook/ardent">Ardent</a> to handle all of that. Ardent allows you to create self-validating Models. This basically means, your Models will validate themselves whenever you interact with them so you don&#8217;t have to write validation logic.</p>
<h2>Installing Ardent through Composer</h2>
<p>Ardent is a Composer package so we can install it by simply adding it to the <code>composer.json</code> file.</p>
<p>Add the following line:</p>
<pre class="brush: jscript; title: ; notranslate">
{
  &quot;require&quot;: {
    &quot;laravelbook/ardent&quot;: &quot;dev-master&quot;
  }
}
</pre>
<p>And then run the following to update your project:</p>
<pre class="brush: bash; title: ; notranslate">
$ composer update
</pre>
<h2>Validating Models using Ardent</h2>
<p>In order to use Ardent, first we need to change where the User Model extends from.</p>
<h3>Extending from Ardent</h3>
<p>In <code>User.php</code> you will need to update the following two lines:</p>
<pre class="brush: php; title: ; notranslate">
// Add this line
use LaravelBook\Ardent\Ardent;

// Update this line
class User extends Ardent implements UserInterface, RemindableInterface {
</pre>
<p>Don&#8217;t worry through, all of Eloquent&#8217;s methods are still available through Ardent because Ardent is a direct decedent from Eloquent.</p>
<h3>Validation rules</h3>
<p>The next thing we need to do is to create a set of validation rules for each of the fields of the Model.</p>
<pre class="brush: php; title: ; notranslate">
/**
 * Ardent validation rules
 */
public static $rules = array(
  'name' =&gt; 'required|between:4,16',
  'email' =&gt; 'required|email',
  'password' =&gt; 'required|alpha_num|min:8|confirmed',
  'password_confirmation' =&gt; 'required|alpha_num|between:4,8',
);
</pre>
<p>Ardent leverages <a href="http://four.laravel.com/docs/validation">Laravel&#8217;s Validation class</a> to create these easy to use validation rules. The validation rules for your model are simply stored as a public static array. As you can see from the values of the array, each rule is separated with a <em>pipe</em>.</p>
<p>For a full list of available validation rules, see <a href="http://four.laravel.com/docs/validation#available-validation-rules">this</a> section of the documentation.</p>
<h3>Using Ardent&#8217;s validation</h3>
<p>As I mentioned in the description of Ardent, all of your models will be &#8220;self validating&#8221;. This means your models will automatically reject input that does not pass your validation rules, without you actually having to do anything:</p>
<p>For example, the following will fail because I&#8217;m not supplying a  password confirmation:</p>
<pre class="brush: php; title: ; notranslate">
$user = new User;
$user-&gt;username = 'philipbrown';
$user-&gt;email = 'phil@ipbrown.com';
$user-&gt;password = 'deadgiveaway';
$user-&gt;save(); // returns false
</pre>
<p>However, the following will save successfully:</p>
<pre class="brush: php; title: ; notranslate">
$user = new User;
$user-&gt;username = 'philipbrown';
$user-&gt;email = 'phil@ipbrown.com';
$user-&gt;password = 'deadgiveaway';
$user-&gt;password_confirmation = 'deadgiveaway';
$user-&gt;save(); // returns true
</pre>
<p>Notice how you don&#8217;t have to validate any of the data yourself? If the validation fails, the model will simply not save.</p>
<h3>Automatically purge redundant data</h3>
<p>We don&#8217;t really want to save the <code>password_confirmation</code> data as this is just used for validation. To tell Ardent to just get rid of the redundant data like confirmation fields, we need to add the following line to the User model.</p>
<pre class="brush: php; title: ; notranslate">
public $autoPurgeRedundantAttributes = true;
</pre>
<h3>Validation example in action</h3>
<p>To quickly set up an example of all of this, we can simply define a new route that we can hit to see it in action.</p>
<p>Open <code>app/routes.php</code> and copy the following code:</p>
<pre class="brush: php; title: ; notranslate">
Route::get('/user', function()
{
  $user = new User;
  $user-&gt;username = 'philipbrown';
  $user-&gt;email = 'phil@ipbrown.com';
  $user-&gt;password = 'deadgiveaway';
  $user-&gt;password_confirmation = 'deadgiveaway';
  var_dump($user-&gt;save());
});
</pre>
<p>This will simply create a new route that you can hit in the browser. When you go to <em>/user</em>, Laravel will automatically create a new user and attempt to save it to the database. If the user is saved correctly, you should see <code>boolean true</code> outputted to the screen.</p>
<p>Save your <code>routes.php</code> and run the following command in Terminal to quickly set up the server:</p>
<pre class="brush: php; title: ; notranslate">
$ php artisan serve
</pre>
<p>Now go to <a href="http://localhost:8000/user">http://localhost:8000/user</a> to see your validation in action.</p>
<p>That was a very quick introduction to validating your Models in Laravel 4. I&#8217;ll be writing a much more in-depth article on the nitty gritty details of validation in the coming weeks.</p>
<h2>Laravel model relationships</h2>
<p>The third and final characteristic of a model is that they hold the information that describes how <em>business objects interact with one another</em>.</p>
<p>Describing the relationship of two models is as easy as creating a new method.</p>
<p>Add the following method to your <code>User.php</code> Model.</p>
<pre class="brush: php; title: ; notranslate">
/**
 * Post relationship
 */
public function posts()
{
  return $this-&gt;hasMany('Post');
}
</pre>
<p>This extremely simple method is all you need to write in order to say <em>a user has many posts</em>.</p>
<p>Now of course, you will need to create the Post Model in order for this to work. I&#8217;m not going to go over creating the Post migration and model. Instead refer back to my <a href="http://culttt.com/2013/05/06/laravel-4-migrations/">Laravel 4 Migrations</a> tutorial. For my Post model, I&#8217;m simply creating a <code>body</code> column and a <code>user_id</code> column. Here is the migration command that I ran.</p>
<pre class="brush: php; title: ; notranslate">
php artisan generate:migration create_posts_table --fields=&quot;body:text, user_id:integer&quot;
</pre>
<p>So your basic Post Model should look like this:</p>
<pre class="brush: php; title: ; notranslate">
class Post extends Eloquent {

  protected $fillable = array('body');

  public function user()
  {
    return $this-&gt;belongsTo('User');
  }
  
}
</pre>
<p>Notice how I have set the inverse of the relationship in the <code>user()</code> method. This is simply saying that each post belongs to a user.</p>
<p>Next, create a new test route in your <code>app/routes.php</code> and paste the following:</p>
<pre class="brush: php; title: ; notranslate">
// Create a new Post
$post = new Post(array('body' =&gt; 'Yada yada yada'));
// Grab User 1
$user = User::find(1);
// Save the Post
$user-&gt;posts()-&gt;save($post);
</pre>
<p>Now if you look in the posts table in your database, you should see that the post has saved and the <code>user_id</code> has automatically been assigned to the user&#8217;s id.</p>
<p>That was a very quick overview of creating relationships in your Laravel Models. Again, I will cover each of these areas in more detail as we add some complexity to Cribbb. To read more about Laravel Model relationships, have a look at the <a href="http://four.laravel.com/docs/eloquent#relationships">documentation</a>.</p>
<h2>Conclusion</h2>
<p>That was a quick overview of how to create Laravel Models. Hopefully you should have a firm understanding of the three important aspects of <em>business logic</em> that should be dealt with within your Models.</p>
<p>As I&#8217;ve mentioned a couple of times in this post, in future tutorials I will be going into much more depth on some of the intricacies of how Models work in web applications.</p>
<p>The observant amongst you will have noticed that I haven&#8217;t strictly followed <a href="http://culttt.com/2013/03/11/what-is-test-driven-development/">Test Driven Development</a>. However, don&#8217;t worry, I will be covering how to write Model tests using <a href="http://culttt.com/2013/03/13/getting-started-with-phpunit/">PHPUnit</a> next week!</p>
<p>This is a series of posts in building an entire Open Source application called <a href="http://cribbb.com">Cribbb</a>. All of the tutorials will be free to web, and all of the code is available on <a href="https://github.com/philipbrown/cribbb">GitHub</a>.</p>
<p>So far I&#8217;ve covered:</p>
<ol>
<li><a href="http://culttt.com/2013/04/29/getting-started-with-laravel-4/">Getting started with Laravel 4</a></li>
<li><a href="http://culttt.com/2013/05/06/laravel-4-migrations/">Laravel 4 Migrations</a>
</ol>
<p>Come back next Monday as I look at how to write automated tests for your Models!</p>
<p><a href="http://culttt.com/2013/05/13/setting-up-your-first-laravel-4-model/">Setting up your first Laravel 4 Model</a> was written by <a rel="author" href="http://culttt.com/author/philipbrown/">Philip Brown</a> on <a href="http://culttt.com">Culttt - Articles on business, technology and the Internet</a></p>]]></content:encoded>
			<wfw:commentRss>http://culttt.com/2013/05/13/setting-up-your-first-laravel-4-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Design Inspiration #84</title>
		<link>http://culttt.com/2013/05/10/design-inspiration-84/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=design-inspiration-84</link>
		<comments>http://culttt.com/2013/05/10/design-inspiration-84/#comments</comments>
		<pubDate>Fri, 10 May 2013 07:20:06 +0000</pubDate>
		<dc:creator>Philip Brown</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://culttt.com/?p=3095</guid>
		<description><![CDATA[<p>Design Inspiration from AppFog, Thinglist, Archer, Wistia and Splitsecnd! Design Inspiration is a weekly post that showcases examples of some of the best new web design from around the internet. To submit to Design Inspiration, click the “submit” link at the bottom of the page and follow the instructions for submitting your site or a [...]</p><p><a href="http://culttt.com/2013/05/10/design-inspiration-84/">Design Inspiration #84</a> was written by <a rel="author" href="http://culttt.com/author/philipbrown/">Philip Brown</a> on <a href="http://culttt.com">Culttt - Articles on business, technology and the Internet</a></p>]]></description>
				<content:encoded><![CDATA[<p>Design Inspiration from AppFog, Thinglist, Archer, Wistia and Splitsecnd!</p>
<p>Design Inspiration is a weekly post that showcases examples of some of the best new web design from around the internet. To submit to Design Inspiration, click the “submit” link at the bottom of the page and follow the instructions for submitting your site or a site you wish to feature.</p>
<p><a href="https://www.appfog.com/"><img src="http://culttt.com/wp-content/uploads/2013/05/AppFog.jpg" alt="AppFog" /></a></p>
<h2>AppFog</h2>
<p><a href="https://www.appfog.com/">https://www.appfog.com</a></p>
<p><a href="http://getthinglist.com/"><img src="http://culttt.com/wp-content/uploads/2013/05/Thinglist.jpg" alt="Thinglist" /></a></p>
<h2>Thinglist</h2>
<p><a href="http://getthinglist.com">http://getthinglist.com</a></p>
<p><a href="http://www.archer-group.com/"><img src="http://culttt.com/wp-content/uploads/2013/05/Archer.jpg" alt="Archer" /></a></p>
<h2>Archer</h2>
<p><a href="http://www.archer-group.com/">http://www.archer-group.com</a></p>
<p><a href="http://wistia.com/"><img src="http://culttt.com/wp-content/uploads/2013/05/Wistia.jpg" alt="Wistia" /></a></p>
<h2>Wistia</h2>
<p><a href="http://wistia.com">http://wistia.com</a></p>
<p><a href="https://www.splitsecnd.com/"><img src="http://culttt.com/wp-content/uploads/2013/05/Splitsecnd.jpg" alt="Splitsecnd" /></a></p>
<h2>Splitsecnd</h2>
<p><a href="https://www.splitsecnd.com">https://www.splitsecnd.com</a></p>
<p><a href="http://culttt.com/2013/05/10/design-inspiration-84/">Design Inspiration #84</a> was written by <a rel="author" href="http://culttt.com/author/philipbrown/">Philip Brown</a> on <a href="http://culttt.com">Culttt - Articles on business, technology and the Internet</a></p>]]></content:encoded>
			<wfw:commentRss>http://culttt.com/2013/05/10/design-inspiration-84/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to fuel the growth of a two sided marketplace</title>
		<link>http://culttt.com/2013/05/08/how-to-fuel-the-growth-of-a-two-sided-marketplace/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-fuel-the-growth-of-a-two-sided-marketplace</link>
		<comments>http://culttt.com/2013/05/08/how-to-fuel-the-growth-of-a-two-sided-marketplace/#comments</comments>
		<pubDate>Wed, 08 May 2013 07:25:33 +0000</pubDate>
		<dc:creator>Philip Brown</dc:creator>
				<category><![CDATA[Strategy]]></category>
		<category><![CDATA[Growth]]></category>

		<guid isPermaLink="false">http://culttt.com/?p=3083</guid>
		<description><![CDATA[<p>Marketplace businesses are notoriously difficult to get off the ground. When you have a two sided marketplace, it can feel like you are in a chicken and egg situation. Without buyers, you can&#8217;t attract sellers and without sellers it&#8217;s almost impossible to attract buyers. However if you can engineer your way to a flourishing two [...]</p><p><a href="http://culttt.com/2013/05/08/how-to-fuel-the-growth-of-a-two-sided-marketplace/">How to fuel the growth of a two sided marketplace</a> was written by <a rel="author" href="http://culttt.com/author/philipbrown/">Philip Brown</a> on <a href="http://culttt.com">Culttt - Articles on business, technology and the Internet</a></p>]]></description>
				<content:encoded><![CDATA[<p><img src="http://culttt.com/wp-content/uploads/2013/05/How-to-fuel-the-growth-of-a-two-sided-marketplace.jpg" alt="How to fuel the growth of a two sided marketplace" /><br />
Marketplace businesses are notoriously difficult to get off the ground. When you have a two sided marketplace, it can feel like you are in a chicken and egg situation. Without buyers, you can&#8217;t attract sellers and without sellers it&#8217;s almost impossible to attract buyers.</p>
<p>However if you can engineer your way to a flourishing two sided marketplace, you are well on your way to building a self perpetuating and defensible business.</p>
<p>Last week I talked about <a href="http://culttt.com/2013/05/01/how-to-build-a-two-sided-marketplace/">how to build a two sided marketplace</a>. This week I want to talk about how to fuel the growth of a two sided marketplace.</p>
<p>In my opinion, there are two main ways to grow a two sided marketplace. Whilst these two factors will not apply to every type of two sided marketplace, I believe they are critical components for the majority of all successful online marketplaces today.</p>
<h2>Adding traction to a two sided marketplace</h2>
<p>As I covered <a href="http://culttt.com/2013/05/01/how-to-build-a-two-sided-marketplace">last week</a>, it can be extremely difficult to get that initial traction in a two sided marketplace. You need to be able to build both sides of the market simultaneously, but without one side, it is almost impossible to build the other side.</p>
<p>But even after you have the initial traction, the hard work is far from over. Now you need to throw fuel onto the fire to grow your marketplace as quickly as possible in order to reap the benefits and defensibility of <a href="http://en.wikipedia.org/wiki/Network_effect">network effects</a>. For many marketplaces, the early days are all about land grab. Usually there will only be one winner and so you must ensure you grow the quickest to become the market leader.</p>
<p>I think two of the most important components of a two sided marketplace growth strategy are <em>virality</em> and <em>becoming a utility</em>.</p>
<h2>Virality in two sided marketplaces</h2>
<p>It should really go without saying that virality is a critical component for building two sided marketplaces. Once you reach scale, the only way to keep growing is to acquire users at a very low cost.</p>
<p>In order to build a viral product, there are a couple of things that you need to keep in mind.</p>
<p>First, you need to create something that naturally creates the requirement of your current users inviting their friends of contacts. There must be some value in the outcome of that process, or your viral coefficient won&#8217;t be nearly big enough.</p>
<p>Secondly, you need to get your Viral Cycle Time as low as possible. This is basically the amount of time that it takes a user to invite their contacts. An ideal Viral Cycle time should be one simple task. If you start making your users jump through hoops the majority will give up before they finish. One of the best examples of a low Viral Cycle time is how easy it is to share a YouTube URL.</p>
<p>If you want to read a more in-depth analysis of viral growth, I&#8217;ve already covered it in the post <a href="http://culttt.com/2012/07/23/finding-your-viral-coefficient/">Finding your Viral Coefficient</a>.</p>
<p>A good example of a two sided marketplace using virality as a means of growth is PayPal&#8217;s huge growth off the back of eBay. Before eBay eventually acquired PayPal in 2002, PayPal accounted for over 40% of the transactions on eBay.</p>
<p>The PayPal example is such a good one because it is a classic viral growth story. Sellers often only accepted PayPal as a means of payment and so buyers only wanted to pay with PayPal because it made the process so easy. Prior to the acquisition, it was common to see eBay listings that had PayPal logos and listing PayPal as the preferred or only method of payment.</p>
<p>PayPal was able to grow virally because its users of the service naturally had reason to get other people on to the service. In order to pay or receive money, you were required to have a PayPal account. This became a self perpetuating process as PayPal piggybacked off the growth of eBay.</p>
<h2>Creating a utility in a two sided marketplace</h2>
<p>I think the second big opportunity for growth in two sided marketplaces is by turning your product into a utility. By this I mean, focusing on allowing your user to accomplish a task, and optimise to make your platform the cheapest and most efficient way of achieving that goal.</p>
<p><img src="http://culttt.com/wp-content/uploads/2013/04/HowAboutWe.jpg" alt="HowAboutWe" /><br />
A couple of weeks ago I wrote about <a href="http://www.howaboutwe.com/">HowAboutWe</a> as part of a post on <a href="http://culttt.com/2013/04/17/how-to-make-the-groupon-business-model-work/">How to make the Groupon business model work</a>. HowAboutWe started off as a online dating site that focused on interesting first dates. Since then, the company has expanded into a couples subscription service that suggest things to do and provides discounts and exclusive opportunities on events.</p>
<p>HowAboutWe is an interesting example because of how they have built their marketplace. In last weeks post on building a two sided marketplace, one of my suggestions was <em>Find a big supplier (established company) for one side of the market</em>. HowAboutWe was able to build their buyers side of the market through the original online dating service. Once they had that traction, the seller side of the market becomes much more interested in the market and getting access to the customer base.</p>
<p>HowAboutWe is a subscription service which includes up to 75% off on a wide range of events and experiences. However, if HowAboutWe can make the discovery and booking process preferable over trawling through individual retailer websites, they can significantly increase their transaction volume by being the go to place to book tickets.</p>
<p>By centralising high quality events and experiences all in one place, and by making the experience of selecting and booking tickets seamless, HowAboutWe can significantly increase the growth and transactions of their marketplace.</p>
<p><img src="http://culttt.com/wp-content/uploads/2013/05/Joor.jpg" alt="Joor" /><br />
Another good example of this model in action is <a href="http://jooraccess.com/">Joor</a>. Joor is a business to business marketplace that connects designers and buyers in the fashion industry. Joor is replacing a multistep process of writing orders down, scanning them into a computer and them emailing or faxing the order to the designer. Instead Joor offers a single platform to connect designers and buyers and because it&#8217;s a marketplace, Joor only makes money when a transaction occurs, so there are no fixed costs on being part of the market.</p>
<p>Again, Joor is able to significantly increase their growth by becoming the preferred method for connecting designers and buyers. Instead of the long, arduous traditional process of placing orders, Joor makes the process simple and efficient. Joor is also able to give smaller designers exposure on the same stage due to no fixed costs and low barriers to entry. As more and more designers and buyers join Joor, growth is going to become self perpetuating as users insist that they conduct all of their transactions through the central platform. This will force the late adopters to also sign up for an account and to start using Joor as their main order platform.</p>
<p>To read more about Joor, take a look at <a href="http://pandodaily.com/2013/04/05/joors-b2b-fashion-marketplace-on-track-to-do-350-million-in-transactions-this-year">this</a> article by PandoDaily.</p>
<h2>How to fuel growth in your two sided marketplace</h2>
<p>It&#8217;s easy to look at the success of other two sided marketplaces and try to extrapolate that the same lessons will apply to any two sided marketplace post traction.</p>
<p>In reality, this is not always the case.</p>
<p>However, generally there are lessons to learn that should be applied to any two sided marketplace looking for growth.</p>
<h3>1. Make virality part of your DNA</h3>
<p>Virality is an extremely important part of building a two sided marketplace. You will need to drive your cost of user acquisition as low as possible, and there is no better way of doing this than encouraging your current user base to attract new users.</p>
<p>Virality needs to be an integral part of your product. It is painfully obvious when attempts at virality have not been thought through from the very start of the development. Getting your Viral Cycle time as low as possible will play a significant role in creating a viral product. Try and make sharing a one step process, and try to think how your product naturally lends itself to a new way of sharing.</p>
<p>You also have to have a very strong reason for why your users should share your product in the first place. Often the best reason for a user to invite their friends or contacts is because it will create direct value for the inviting users. In the PayPal and eBay example, both buyers and sellers would usually require the other party to make the transaction through PayPal.</p>
<p>Virality has become an overused strategy for trying to fuel growth. However, it only really works if both the current user and the user who is being invited both derive value from becoming part of the network.</p>
<h3>2. Become a utility</h3>
<p>The second big opportunity to fuel growth of a two sided marketplace is to become a utility. When you are solving a problem that your users face every day, the volume of transactions within your marketplace will grow much quicker. The problem with many marketplaces is, the problem they are solving is a one time occurrence.</p>
<p>Instead, by becoming a utility, you can transform your product from a novelty to something that your users rely upon in their daily activity. Both HowAboutWe and Joor show how this can be done for two similar, but different models.</p>
<p>Much of eBay&#8217;s growth can be attributed to the marketplace becoming full time employment for millions of sellers all over the globe. When you can provide this type of value for your users, growth becomes inevitable.</p>
<p>To read more about this, take a look at my post <a href="http://culttt.com/2012/02/15/moving-your-product-from-a-fad-to-a-utility/">Moving your product from a fad to a utility</a>.</p>
<p>What have you found to be good strategies for growing two sided marketplaces?</p>
<p><a href="http://culttt.com/2013/05/08/how-to-fuel-the-growth-of-a-two-sided-marketplace/">How to fuel the growth of a two sided marketplace</a> was written by <a rel="author" href="http://culttt.com/author/philipbrown/">Philip Brown</a> on <a href="http://culttt.com">Culttt - Articles on business, technology and the Internet</a></p>]]></content:encoded>
			<wfw:commentRss>http://culttt.com/2013/05/08/how-to-fuel-the-growth-of-a-two-sided-marketplace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Laravel 4 Migrations</title>
		<link>http://culttt.com/2013/05/06/laravel-4-migrations/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=laravel-4-migrations</link>
		<comments>http://culttt.com/2013/05/06/laravel-4-migrations/#comments</comments>
		<pubDate>Mon, 06 May 2013 07:30:11 +0000</pubDate>
		<dc:creator>Philip Brown</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Cribbb]]></category>
		<category><![CDATA[Laravel]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://culttt.com/?p=3080</guid>
		<description><![CDATA[<p>If you have ever worked on a big project with multiple developers, you will probably have found that keeping everyone&#8217;s database structure consistent can be a nightmare. For example, say one of your colleagues adds a new feature, and in doing so, is required to add a new column to the database. They commit their [...]</p><p><a href="http://culttt.com/2013/05/06/laravel-4-migrations/">Laravel 4 Migrations</a> was written by <a rel="author" href="http://culttt.com/author/philipbrown/">Philip Brown</a> on <a href="http://culttt.com">Culttt - Articles on business, technology and the Internet</a></p>]]></description>
				<content:encoded><![CDATA[<p><img src="http://culttt.com/wp-content/uploads/2013/05/Laravel-4-Migrations.jpg" alt="Laravel 4 Migrations" /><br />
If you have ever worked on a big project with multiple developers, you will probably have found that keeping everyone&#8217;s database structure consistent can be a nightmare.</p>
<p>For example, say one of your colleagues adds a new feature, and in doing so, is required to add a new column to the database. They commit their code to Git and then push it to the repo. The next time you go to work on the project you pull the latest code down but you end up with a load of errors and a broken application because your database schema is now out of date.</p>
<p>Passing around a SQL dump is a horrible makeshift solution and it is totally inadequate for updating the production server because it causes downtime and things can go wrong due to human error.</p>
<p>Fortunately, Migrations are the answer to all of these problems.</p>
<h2>What are Migrations?</h2>
<p>Migrations are essentially a way to version control your database. Migrations are a series of timestamped instructions for making changes to your database. This allows you to record the changes you make to the schema so anyone else can simply run the instruction file to update their version of the database to keep things consistent. It also allows you to roll back any changes you have made to a database in the event that you made a mistake.</p>
<p>Even if you aren&#8217;t working with other developers, Migrations are really an essential part of building an application because it means you no longer have to write SQL or deal with a janky interface like phpMyAdmin. It also makes shipping live code much less stressful because you don&#8217;t have to worry about making changes to the live database.</p>
<p>If you have never used Migrations before, it can be kind of weird to think that you need them. But in all honesty, once you start using them, you will never go back.</p>
<h2>Using Migrations in Laravel 4</h2>
<p>Laravel 4 comes ready with Migrations out of the box. Using the <code>artisan</code> command line interface you can create new migrations just by running a single command.</p>
<p>However, in this tutorial we will be making our lives even easier by installing a fantastic package for Laravel Generators.</p>
<p>So here&#8217;s how to set up Migrations in Laravel 4.</p>
<h2>Setting up the database</h2>
<p>The first thing we need to do is to set up the database. Laravel provides you with a simple configuration file to save your database details, username and password.</p>
<p>Firstly, set up a new local database and create a new user. Next go to <code>app/config/database.php</code> and fill in your database details in the <code>connections</code> array.</p>
<pre class="brush: php; title: ; notranslate">
  'mysql' =&gt; array(
    'driver'    =&gt; 'mysql',
    'host'      =&gt; 'localhost',
    'database'  =&gt; 'cribbb',
    'username'  =&gt; 'cribbb',
    'password'  =&gt; '',
    'charset'   =&gt; 'utf8',
    'collation' =&gt; 'utf8_unicode_ci',
    'prefix'    =&gt; '',
  ),
</pre>
<p>Notice how easy it is to switch the type of database that you are using. All you would have to do is to change the <code>default</code> value.</p>
<h2>Installing Laravel 4 Generators</h2>
<p>Although Laravel 4 comes with Migrations out of the box, we can make them even easier by using the <a href="https://github.com/JeffreyWay/Laravel-4-Generators">Laravel 4 Generator</a> package by <a href="https://github.com/JeffreyWay">Jeffrey Way</a>.</p>
<p>First, open up your <code>composer.json</code> and add the Laravel 4 Generator package as a requirement:</p>
<pre class="brush: jscript; title: ; notranslate">
&quot;require&quot;: {
  &quot;laravel/framework&quot;: &quot;4.0.*&quot;,
  &quot;way/generators&quot;: &quot;dev-master&quot;
}
</pre>
<p>Next, update Composer from the Terminal:</p>
<pre class="brush: bash; title: ; notranslate">
$ composer update
</pre>
<p>Finally, go into <code>app/config/app.php</code> and add the following line at the end of the providers array:</p>
<pre class="brush: php; title: ; notranslate">
'Way\Generators\GeneratorsServiceProvider'
</pre>
<p>Now if you run <code>php artisan</code> from the command line you should see the new generator tasks.</p>
<h2>How do Migrations work?</h2>
<p>Migrations are basically just a set of timestamped instruction files that can be automatically run to modify a database. A migration file contains a class which have a series of SQL based methods for adding tables, updating columns or dropping a table all together.</p>
<p>In the migration file you will find an <code>up</code> method and a <code>down</code> method. This allows the migration file to make changes to a database, but also roll back those changes if it is required.</p>
<p>When a migration is run, it is recorded in a special <code>migrations</code> table in your database. This means Laravel knows which migrations have already run, and which are still needed to run to bring the database up to speed.</p>
<p>To create the <code>migrations</code> table, run the following command from Terminal:</p>
<pre class="brush: bash; title: ; notranslate">
$ php artisan migrate:install
</pre>
<p>If you now look in your database, you should see the new <code>migrations</code> table.</p>
<h2>Creating a Migration</h2>
<p><a href="http://cribbb.com">Cribbb</a> is going to be a social application so we need a table to store details of our users. In order to do that, we need to create a migration to create the <em>users</em> table.</p>
<p>To create the Migration, run the following line from the command line:</p>
<pre class="brush: bash; title: ; notranslate">
$ php artisan generate:migration create_users_table --fields=&quot;email:string, password:string&quot;
</pre>
<p>Now if you look under the <code>app/database/migrations</code> directory, you should see the new timestamped Migration file.</p>
<h2>The anatomy of a Migration</h2>
<p>When you run the Migration command above, Laravel will understand that you want to create a table called users. The fields option allows us to create fields for the table, in this case two fields called <em>email</em> and <em>password</em> which are both VARCHAR (which just means string).</p>
<p>Now if you look in the generated Migration file, you should have the following:</p>
<pre class="brush: php; title: ; notranslate">
class CreateUsersTable extends Migration {

  /**
   * Run the migrations.
   *
   * @return void
   */
  public function up()
  {
    Schema::create('users', function(Blueprint $table) {
      $table-&gt;increments('id');
      $table-&gt;string('email');
      $table-&gt;string('password');
      $table-&gt;timestamps();
    });
  }

  /**
   * Reverse the migrations.
   *
   * @return void
   */
  public function down()
  {
    Schema::drop('users');
  }
}
</pre>
<p>Basically, all a Migration is, is a class with <code>up</code> and <code>down</code> methods. When the Migration is run, the instructions in the <code>up</code> method are run. When the Migration is rolled back, the instructions in the <code>down</code> method are run.</p>
<p>As you can see in this case, the <code>up</code> method creates the table and the default fields as well as the email and passwords fields that we specified from the command line. In the <code>down</code> method, the Migration will simply drop the table from the database.</p>
<p>If you run the migrate command now from the Terminal, Laravel will create the <code>users</code> table for you:</p>
<pre class="brush: bash; title: ; notranslate">
php artisan migrate
</pre>
<h2>Adding a column with a Migration</h2>
<p>If you want to add a column to a table using a Migration, you simply have to run a slightly different command to generate the right instructions.</p>
<p>For example, we also want our users to have a username.</p>
<p>To add this column, you would simply run this command in Terminal:</p>
<pre class="brush: bash; title: ; notranslate">
$ php artisan generate:migration add_username_to_users_table --fields=&quot;username:string&quot;
</pre>
<p>Notice how it is <code>add</code> instead of <code>create</code>? This will create the following Migration file.</p>
<pre class="brush: php; title: ; notranslate">
class AddUsernameToUsersTable extends Migration {

  /**
   * Run the migrations.
   *
   * @return void
   */
  public function up()
  {
    Schema::table('users', function(Blueprint $table) {
      $table-&gt;string('username');
    });
  }

  /**
   * Reverse the migrations.
   *
   * @return void
   */
   public function down()
   {
     Schema::table('users', function(Blueprint $table) {
       $table-&gt;dropColumn('username');
   });
 }
}
</pre>
<p>Again, run the <code>migrate</code> command from Terminal to add the username column to the users table.</p>
<pre class="brush: bash; title: ; notranslate">
$ php artisan migrate
</pre>
<h2>Read more about Laravel Migrations</h2>
<p>See, how easy was that? Now that you have simple version control for your database, other developers can easily get started working on your project and rolling out changes to the server will be a breeze.</p>
<p>To read more about Laravel Migrations, take a look at the following articles as well as as the <a href="http://four.laravel.com/docs/migrations">Laravel 4 documentation</a>.</p>
<ul>
<li><a href="http://codehappy.daylerees.com/migrations">Code Happy &#8211; Migrations</a></li>
<li><a href="http://laravelbook.com/laravel-migrations-managing-databases/">Managing Databases with Migrations</a></li>
</ul>
<p>This tutorial is the second in a series of posts showing you how to build an entire web application from scratch. All of the tutorials will be free to web and you see all of the code up on <a href="https://github.com/philipbrown/cribbb">GitHub</a>.</p>
<p>Last week I covered <a href="http://culttt.com/2013/04/29/getting-started-with-laravel-4/">getting started with Laravel 4</a>.</p>
<p>Follow us on <a href="http://twitter.com/culttt">Twitter</a>, <a href="http://facebook.com">Facebook</a> or <a href="https://plus.google.com/105545788844824874492/posts">Google Plus</a> to make sure you never miss a post!</p>
<p><a href="http://culttt.com/2013/05/06/laravel-4-migrations/">Laravel 4 Migrations</a> was written by <a rel="author" href="http://culttt.com/author/philipbrown/">Philip Brown</a> on <a href="http://culttt.com">Culttt - Articles on business, technology and the Internet</a></p>]]></content:encoded>
			<wfw:commentRss>http://culttt.com/2013/05/06/laravel-4-migrations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Design Inspiration #83</title>
		<link>http://culttt.com/2013/05/03/design-inspiration-83/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=design-inspiration-83</link>
		<comments>http://culttt.com/2013/05/03/design-inspiration-83/#comments</comments>
		<pubDate>Fri, 03 May 2013 07:20:23 +0000</pubDate>
		<dc:creator>Philip Brown</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://culttt.com/?p=3071</guid>
		<description><![CDATA[<p>Design Inspiration from Ghost, Taasky, Flinto, Hammer and Spendee! Design Inspiration is a weekly post that showcases examples of some of the best new web design from around the internet. To submit to Design Inspiration, click the “submit” link at the bottom of the page and follow the instructions for submitting your site or a [...]</p><p><a href="http://culttt.com/2013/05/03/design-inspiration-83/">Design Inspiration #83</a> was written by <a rel="author" href="http://culttt.com/author/philipbrown/">Philip Brown</a> on <a href="http://culttt.com">Culttt - Articles on business, technology and the Internet</a></p>]]></description>
				<content:encoded><![CDATA[<p>Design Inspiration from Ghost, Taasky, Flinto, Hammer and Spendee!</p>
<p>Design Inspiration is a weekly post that showcases examples of some of the best new web design from around the internet. To submit to Design Inspiration, click the “submit” link at the bottom of the page and follow the instructions for submitting your site or a site you wish to feature.</p>
<p><a href="http://tryghost.org/"><img src="http://culttt.com/wp-content/uploads/2013/05/Ghost.jpg" alt="Ghost" /></a></p>
<h2>Ghost</h2>
<p><a href="http://tryghost.org/">http://tryghost.org</a></p>
<p><a href="http://www.taasky.com/"><img src="http://culttt.com/wp-content/uploads/2013/05/Taasky.jpg" alt="Taasky" /></a></p>
<h2>Taasky</h2>
<p><a href="http://www.taasky.com/">http://www.taasky.com</a></p>
<p><a href="https://www.flinto.com/"><img src="http://culttt.com/wp-content/uploads/2013/05/Flinto.jpg" alt="Flinto" /></a></p>
<h2>Flinto</h2>
<p><a href="https://www.flinto.com/">https://www.flinto.com</a></p>
<p><a href="http://hammerformac.com/"><img src="http://culttt.com/wp-content/uploads/2013/05/Hammer.jpg" alt="Hammer" /></a></p>
<h2>Hammer</h2>
<p><a href="http://hammerformac.com/">http://hammerformac.com</a></p>
<p><a href="http://www.spendeeapp.com/"><img src="http://culttt.com/wp-content/uploads/2013/05/Spendee.jpg" alt="Spendee" /></a></p>
<h2>Spendee</h2>
<p><a href="http://www.spendeeapp.com/">http://www.spendeeapp.com</a></p>
<p><a href="http://culttt.com/2013/05/03/design-inspiration-83/">Design Inspiration #83</a> was written by <a rel="author" href="http://culttt.com/author/philipbrown/">Philip Brown</a> on <a href="http://culttt.com">Culttt - Articles on business, technology and the Internet</a></p>]]></content:encoded>
			<wfw:commentRss>http://culttt.com/2013/05/03/design-inspiration-83/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to build a two sided marketplace</title>
		<link>http://culttt.com/2013/05/01/how-to-build-a-two-sided-marketplace/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-build-a-two-sided-marketplace</link>
		<comments>http://culttt.com/2013/05/01/how-to-build-a-two-sided-marketplace/#comments</comments>
		<pubDate>Wed, 01 May 2013 07:24:34 +0000</pubDate>
		<dc:creator>Philip Brown</dc:creator>
				<category><![CDATA[Strategy]]></category>
		<category><![CDATA[Business Model]]></category>
		<category><![CDATA[Growth]]></category>

		<guid isPermaLink="false">http://culttt.com/?p=3048</guid>
		<description><![CDATA[<p>Two side marketplace businesses are possibly one of the holy grails of online business models. In a two sided marketplace, buyers and sellers conduct transactions through a centralised platform. Both sides of the marketplace are self organised and so, the platform owner is able to take a transactional &#8220;rake&#8221;. These types of businesses are extremely [...]</p><p><a href="http://culttt.com/2013/05/01/how-to-build-a-two-sided-marketplace/">How to build a two sided marketplace</a> was written by <a rel="author" href="http://culttt.com/author/philipbrown/">Philip Brown</a> on <a href="http://culttt.com">Culttt - Articles on business, technology and the Internet</a></p>]]></description>
				<content:encoded><![CDATA[<p><img src="http://culttt.com/wp-content/uploads/2013/04/How-to-build-a-two-sided-marketplace.jpg" alt="How to build a two sided marketplace" /><br />
Two side marketplace businesses are possibly one of the holy grails of online business models. In a two sided marketplace, buyers and sellers conduct transactions through a centralised platform. Both sides of the marketplace are self organised and so, the platform owner is able to take a transactional &#8220;rake&#8221;.</p>
<p>These types of businesses are extremely defensible because of the <a href="http://en.wikipedia.org/wiki/Network_effect">network effects</a> of marketplaces and the high <a href="http://en.wikipedia.org/wiki/Switching_barriers">switching costs</a> of moving to another marketplace. For each new buyer or seller that enters the market, the market as a whole becomes stronger and without the dense population of an existing marketplace, users will not switch to an alternative.</p>
<p>Two sided marketplaces are the holy grail because they are incredibly difficult to pull off due to the <a href="http://en.wikipedia.org/wiki/Chicken_or_the_egg">Chicken or the egg</a> dilemma. Without buyers, you won&#8217;t attract sellers, and without sellers you won&#8217;t attract buyers.</p>
<p>Some of the most prominent and established online giants maintain a healthy competitive advantage over rivals and newcomers because they have cracked the two sided marketplace problem. Companies like eBay and Craigslist continue to dominate their respective industries because both buyers and sellers won&#8217;t leave without the other side of the market.</p>
<p>Whilst taking on a giant like eBay can seem like an impossible task, there are plenty of other marketplace opportunities that have not yet been explored. If you can find uncharted territory, and build a two sided marketplace, you can create a very defensible and strong online business.</p>
<h2>Tactics for building two sided market places</h2>
<p>In this post I&#8217;m going to look at the tactics for building a two sided marketplace. I&#8217;m keeping this pretty agnostic in terms of industry and exact business model, so whilst not every tactic will work for your specific situation, hopefully you will find some that do.</p>
<h3>Start with a niche</h3>
<p>Probably the most important overall strategy for building a two sided marketplace is that you must start with a niche. Trying to target a market opportunity that is too big, or take on a competitor head on is a recipe for failure. If you try to appeal to everyone, you will end up appealing to no one.</p>
<p>The first thing you need to do is to pick a very specific target market and completely dominate it before expanding into bigger or adjacent markets. You need to become a household name within that tight niche market because you need the recognition and momentum to move into bigger segments.</p>
<p>For every opportunity, there will likely be hundreds of possible niches. For example, you might target a specific geographical location, demographic or niche interest. You can&#8217;t really pick an opportunity that is <em>too</em> small at this stage, but it&#8217;s important that you can envision how you will be able to logically expand into adjacent areas.</p>
<p>Starting with a <em>beachhead</em> is one of the key take aways from Geoffrey A. Moore&#8217;s, <a href="http://culttt.com/2011/10/10/crossing-the-chasm-review/">Crossing the chasm</a>. By establishing yourself within a niche, you begin to create leverage for your company and momentum for attacking the wider mass market.</p>
<p>If you are looking to take on an established incumbent, it is imperative that you focus on a single niche that the incumbent is either over-serving or under-serving. When an existing incumbent is over-serving a market segment, there is an opportunity for you to enter the market with a much lower cost product. When the incumbent is under-serving a market segment, there is an opportunity for you to enter the market with a differentiated, more focused product that better meets that customer&#8217;s needs. You can read more about this strategy in my post, <a href="http://culttt.com/2013/04/24/how-to-find-disruptive-opportunities/">How to find disruptive opportunities</a>.</p>
<h3>Creating a community through content</h3>
<p>When you start on day one of building a two sided marketplace business, no one will know who you are and they won&#8217;t care about what you are trying to do. In reality, it will probably take a long time for anyone to really care about what you are building, even if you are incredibly passionate about solving their particular problem.</p>
<p>I&#8217;m a big fan of online businesses that utilise content for growth. Whilst the majority of people view content as a throwaway commodity, I believe it can be a huge driver of growth and loyalty and a much better way of marketing your company and creating inbound demand.</p>
<p>One of the main problems with building a two sided marketplace is lack of traction and demand. When you open your door up on launch day, you need to have an already engaged audience who are already actively using your product.</p>
<p>It&#8217;s very difficult to find this type of audience for an unreleased and unproven product. However, I think producing quality related content is the best strategy for building that kind of initial interest.</p>
<p>I&#8217;ve recently wrote about <a href="http://culttt.com/2013/03/27/why-groundswell-is-critical-to-building-successful-online-products/">Why groundswell is critical to building successful online products</a> as well as a deep dive on <a href="http://culttt.com/2013/01/09/the-intersection-of-content-and-commerce/">The intersection of content and commerce</a>.</p>
<p>What it all comes down to is, producing content enables you to build an engaged audience around a topic. If you want your product to be successful, you need distribution and marketing. Instead of launching on day one into the abyss, you can create a engaged following by creating content and a community long before your launch.</p>
<h3>Single player mode</h3>
<p>Up until now I&#8217;ve mostly talked about transactional two sided marketplaces. But there are many other types of business model that favour the dynamics of a two sided marketplace.</p>
<p>For example, any product that connects two users together through social or utility type features will benefit from the network effects and switching costs of a two sided marketplace. However, even in this situation, the model can be a difficult one to build.</p>
<p><a href="http://twitter.com/fredwilson">Fred Wilson</a> wrote an interest blog post on <a href="http://www.avc.com/a_vc/2012/12/single-user-utility-in-a-social-system.html">Single user utility in a social system</a>. Basically, this means that you can create a two sided marketplace by first building traction of your product around single user usage. For example, if a user can use a product by themselves, without the other side of the market, you can gain the benefits of a two sided marketplace once you open up those features that require traction on both sides in order to add value.</p>
<p>A good example of this would be any type of utility application that allows a user to derive value from usage. If the user&#8217;s usage can be opened up to benefit them as well as the wider marketplace, you can hack your way into a two sided marketplace by focusing on the single user utility. For more on this, read my post <a href="http://culttt.com/2012/02/15/moving-your-product-from-a-fad-to-a-utility/">Moving your product from a fad to a utility</a>.</p>
<h3>Find a big supplier (established company) for one side of the market</h3>
<p>An interesting application of the two sided marketplace is where you connect a buyer to a seller where the buyer is an already established company. Although ideally you want both buyers and sellers to be decentralised and self organising, by using an existing company as your &#8220;supplier&#8221; you are able to build a two sided marketplace by concentrating on only one side of the market.</p>
<p>I wrote about an interesting real life case study of this opportunity in the post, <a href="http://culttt.com/2013/04/10/adding-a-service-layer-to-incumbent-industries-through-discovery-and-curation/">Adding a service layer to incumbent industries through discovery and curation</a>. In that post I looked at competing mobile music discovery services <a href="https://www.getwillcall.com/">WillCall</a> and <a href="http://jukely.com/">Jukely</a>.</p>
<p>Both WillCall and Jukely are building services that connect passionate music fans with live music events. Users can discover new events in their area and purchase tickets straight from the app.</p>
<p>This would seem like the perfect opportunity to create a two sided marketplace by using an existing supplier on one side, whilst you build an engaged audience on the other. In this case, the seller side of the marketplace could be the monolithic ticket seller that is able to provide access to the majority of all music events. However, because the service is able to build the demand side of the market, the incumbent established ticket provider can be replaced with smaller, more decentralised ticket sellers who want to connect to that audience.</p>
<h3>Start with non-scalable things</h3>
<p>The ultimate goals of creating a two sided marketplace is that it is a business model that scales indefinitely. The real beauty of two sided marketplaces is the power of the network and how each side self organises around the platform.</p>
<p>However, at the outset you are a long way from building a completely scalable model, and so, you should not be scared of doing non-scalable things in the short run.</p>
<p>For example, say you are connecting two established but non-connected existing systems. It is likely that in order to make the connection work early on, there will be some manual work. This often means instead of directly connecting the two sides of the market, you have to act like a middle man to make the connection. Whilst this setup won&#8217;t scale with usage, it can mean you get the foothold you need to start connecting the two sides directly.</p>
<p>For example, say you are building a resource allocation marketplace around power tools within a local area. You could facilitate the early growth of the market by directly reaching out to owners of power tools and new homeowners who require them in order to connect the two sides of the market. I&#8217;ve already wrote extensively on this opportunity in the post, <a href="http://culttt.com/2013/02/20/the-huge-opportunity-of-resource-allocation-in-connected-marketplaces/">The huge opportunity of resource allocation in connected marketplaces</a>.</p>
<h3>Piggy back off someone else</h3>
<p>If you are solving a real problem, it is likely that at least some of your potential audience is already solving the problem in some way or another.</p>
<p>A good real life example of this is how <a href="https://www.airbnb.com">Airbnb</a> got it&#8217;s early traction. For a long time, <a href="http://craigslist.com">Craigslist</a> was the established leader in short term apartment rentals. Craigslist already had the demand on both sides of the market, but it was hard work to create listings using the Craigslist interface and the anonymous nature of the system meant it wasn&#8217;t the best way to find reputable people. Nevertheless, the demand on both sides of the market were at Craigslist despite these drawbacks.</p>
<p>Airbnb created their system which allowed people to post to Craigslist as well as Airbnb at the same time. This meant that it&#8217;s early users had a better experience when posting listings and they could benefit from posting to both marketplaces at the same time. Craigslist was a much bigger market, and so it would of been extremely difficult to convince users to switch to a different marketplace cold turkey. But by building a tool that made the switch easier, Airbnb was able to piggy back traction from the established incumbent.</p>
<h2>Conclusion</h2>
<p>Two sided marketplace businesses are very attractive because they are defensible and able to scale with a clear repeatable business model. Whilst it can be extremely difficult to get to post-traction, once you reach that stage you have often captured almost the entire market.</p>
<p>I&#8217;m really interested in the transactional nature of these types of businesses. When you, as the platform owner, can generate revenue by facilitating and connecting both sides of the market, you can build a very exciting business. Prominent Venture Capitalist <a href="https://twitter.com/bgurley">Bill Gurley</a> recently wrote a fantastic article on <a href="http://abovethecrowd.com/2013/04/18/a-rake-too-far-optimal-platformpricing-strategy/">Optimal Platform Pricing Strategy</a> for these types of marketplaces.</p>
<p>Building a two sided marketplace is widely recognised as a difficult, but potentially lucrative opportunity. If you are interested in reading more about how others have achieved traction, or more ideas for building a marketplace for yourself, have a read of the following posts:</p>
<ul>
<li><a href="http://mashable.com/2011/03/31/grow-startup-market/">7 Tips For Growing a Two-Sided Online Marketplace</a></li>
<li><a href="http://venturebeat.com/2013/04/14/launching-a-two-sided-marketplace-how-to-kickstart-supply-and-demand/">Launching a two-sided marketplace: How to kickstart supply and demand</a></li>
<li><a href="http://www.forbes.com/sites/ciocentral/2013/02/07/5-tips-for-building-a-two-sided-online-marketplace/">5 Tips For Building A Two-Sided Online Marketplace</a></li>
<li><a href="http://tech.co/airbnb-two-sided-networks-2010-12">Airbnb: A lesson in building two sided networks</a></li>
</ul>
<p>What have you found to be good strategies for building two sided marketplaces?</p>
<p><a href="http://culttt.com/2013/05/01/how-to-build-a-two-sided-marketplace/">How to build a two sided marketplace</a> was written by <a rel="author" href="http://culttt.com/author/philipbrown/">Philip Brown</a> on <a href="http://culttt.com">Culttt - Articles on business, technology and the Internet</a></p>]]></content:encoded>
			<wfw:commentRss>http://culttt.com/2013/05/01/how-to-build-a-two-sided-marketplace/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Getting started with Laravel 4</title>
		<link>http://culttt.com/2013/04/29/getting-started-with-laravel-4/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=getting-started-with-laravel-4</link>
		<comments>http://culttt.com/2013/04/29/getting-started-with-laravel-4/#comments</comments>
		<pubDate>Mon, 29 Apr 2013 07:25:23 +0000</pubDate>
		<dc:creator>Philip Brown</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Cribbb]]></category>
		<category><![CDATA[Laravel]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://culttt.com/?p=3043</guid>
		<description><![CDATA[<p>Laravel 4 is the upcoming latest release of the popular PHP framework Laravel. Laravel is a &#8220;clean and classy&#8221; modern PHP framework for building web applications. Heavily inspired by the likes of Ruby on Rails, as well as other modern PHP frameworks like Symfony, Laravel 4 aims to show how far PHP has matured over [...]</p><p><a href="http://culttt.com/2013/04/29/getting-started-with-laravel-4/">Getting started with Laravel 4</a> was written by <a rel="author" href="http://culttt.com/author/philipbrown/">Philip Brown</a> on <a href="http://culttt.com">Culttt - Articles on business, technology and the Internet</a></p>]]></description>
				<content:encoded><![CDATA[<p><img src="http://culttt.com/wp-content/uploads/2013/04/Getting-started-with-Laravel-4.jpg" alt="Getting started with Laravel 4" /><br />
<a href="https://github.com/laravel/framework">Laravel 4</a> is the upcoming latest release of the popular PHP framework <a href="http://laravel.com">Laravel</a>. Laravel is a <em>&#8220;clean and classy&#8221;</em> modern PHP framework for building web applications. Heavily inspired by the likes of <a href="http://rubyonrails.org/">Ruby on Rails</a>, as well as other modern PHP frameworks like <a href="http://symfony.com/">Symfony</a>, Laravel 4 aims to show how far PHP has matured over the last couple of years by allowing you to write great web applications from scratch.</p>
<p>Laravel 4 builds upon the hugely successful <a href="http://laravel.com">Laravel 3 framework</a>, but has taken some dramatic steps forward since the last release. Laravel 4 is now a much more testable framework, whilst still maintaining it&#8217;s clean and clear syntax as well as adding a wide array of new components and features.</p>
<p>Laravel 4 leverages <a href="http://getcomposer.org/">Composer</a> to manage updates and to decouple the framework into individual components. You are now much more free to mix and match components from the PHP community. Laravel 4 itself uses some of the most popular components from the Symfony framework, amongst others, so that it does not have to reinvent the wheel.</p>
<p>All of these reasons make Laravel 4 the perfect choice of PHP framework for your next project.</p>
<p>Laravel 4 has not been officially released yet, although the final version release is imminent. However, you can still get started with the framework today.</p>
<p>In this tutorial I&#8217;m going to show you everything you need to get started with Laravel 4.</p>
<p>This is actually the second time that I have written this tutorial. The first time I was just explaining the process for setting up Laravel 4 that loosely followed the <a href="http://four.laravel.com">documentation</a>. However, after reading <a href="http://fideloper.com/best-way-to-install-laravel4">this</a> great tutorial by <a href="https://twitter.com/fideloper">Chris Fidao</a>, I decided to rewrite my guide but follow the slightly different method provided by <a href="https://twitter.com/akuzemchak">Aaron Kuzemchak</a> <a href="https://gist.github.com/akuzemchak/5210425">here</a>. So kudos to those two, you learn something new everyday. The majority of this post will be standing on the shoulder of giants, but hopefully I can expand on some of the nuances in getting started with Laravel 4.</p>
<h2>Requirements</h2>
<p>Laravel 4 pretty much needs no configuration out of the box. However, there are a couple of requirements you will need on your local machine.</p>
<p>Firstly you will need to install <a href="http://getcomposer.org/">Composer</a>. Composer is a handy package manager for PHP that allows you to update and manage the different components of your project. If you haven&#8217;t already got Composer set up, take a look at my tutorial, <a href="http://culttt.com/2013/01/07/what-is-php-composer/">What is PHP composer?</a>.</p>
<p>You will also need to be running <code>PHP >= 5.3.7</code> and you need the <code>MCrypt PHP Extension</code> to be installed. I will be using PHP 5.4+. I&#8217;m using OS X, and so the rest of this tutorial will reference that operating system. I&#8217;ll assume that you are already have your environment set up, because it&#8217;s outside the scope of this tutorial.</p>
<p>And finally, you will of course need to have Git installed. If you are new to Git, take a look at my overview, <a href="http://culttt.com/2012/10/10/why-you-need-to-start-using-git-today/">Why you need to start using Git today</a>.</p>
<h2>Installing Laravel 4</h2>
<p>So the first thing we need to do is to clone the Laravel repository from GitHub. As I mentioned at the top of this post, Laravel 4 hasn&#8217;t officially been released yet, but we can start using it today by cloning the <code>develop</code> branch.</p>
<pre class="brush: bash; title: ; notranslate">
$ git clone -o laravel -b develop https://github.com/laravel/laravel.git cribbb
</pre>
<p>Here I&#8217;m using the <code>git clone</code> command to get the latest copy of the framework and save it into the directory named <code>cribbb</code>.</p>
<p><code>-o laravel</code> means the remote branch will be named <em>laravel</em> instead of the default of <em>origin</em>. This is so we can pull in changes to the framework, but still maintain our own <code>origin</code>.</p>
<p><code>-b develop</code> means we want the <code>develop</code> branch.</p>
<p>To read more about the <code>git clone</code> command, take a look at the <a href="http://git-scm.com/docs/git-clone">documentation</a>.</p>
<p>Once the Laravel repo has been cloned, move into the project directory:</p>
<pre class="brush: bash; title: ; notranslate">
cd cribbb
</pre>
<p>Next we need to create our own Master branch so this project starts at the beginning of it&#8217;s own timeline. To do this, run the following command.</p>
<pre class="brush: bash; title: ; notranslate">
git checkout --orphan master
</pre>
<p>This basically creates a new branch with a new timeline with no parent branches and calls it Master.</p>
<p>Again, to read more about this specific command and the options, take a look at the in-depth <a href="http://git-scm.com/docs/git-checkout">documentation</a>.</p>
<p>Now we need to commit the changes.</p>
<p>Run the following command to see all the new framework files that have not been committed to our repo yet:</p>
<pre class="brush: bash; title: ; notranslate">
git status
</pre>
<p>Next, commit all the files with a message:</p>
<pre class="brush: bash; title: ; notranslate">
git commit -m &quot;Initial commit&quot;
</pre>
<p>Now when you want to update Laravel, you can run:</p>
<pre class="brush: bash; title: ; notranslate">
git fetch laravel
</pre>
<p><code>git fetch</code> will download updates from the <code>laraval</code> repository (<a href="http://git-scm.com/docs/git-fetch">documentation</a>).</p>
<p>And to merge updates, you would run the following command:</p>
<pre class="brush: bash; title: ; notranslate">
git merge --squash -m &quot;Upgrade Laravel&quot; laravel/develop
</pre>
<p>This will merge the updates as one commit (<a href="http://git-scm.com/docs/git-merge">documentation</a>).</p>
<p>Now you can run <code>composer update</code> to update any composer registered libraries (note I&#8217;m running <code>composer.phar</code> globally from my <code>usr/local/bin</code> directory).</p>
<pre class="brush: bash; title: ; notranslate">
composer update
</pre>
<p>Now that you have this set up, whenever a component is updated you can just run <code>composer update</code> to get the latest updates without having to mess with updating files within directories.</p>
<p>And finally, set your own <code>origin</code> by running the following command with your own git repo url.</p>
<pre class="brush: bash; title: ; notranslate">
git remote add origin git@github.com:philipbrown/cribbb.git
</pre>
<h2>Configuring Laravel</h2>
<p>The only configuration option that we need to set up now is to create the encryption key that is used within the framework. To do this, all we need to do is to run:</p>
<pre class="brush: bash; title: ; notranslate">
php artisan key:generate
</pre>
<h2>Running Laravel</h2>
<p>Now that we have Laravel installed, it&#8217;s all ready to run. If you are using PHP 5.4, you can run the following command from Terminal to quickly start up the server without having to create a new Virtual Host.</p>
<pre class="brush: bash; title: ; notranslate">
$ php artisan serve
</pre>
<p>Now if you visit <a href="http://localhost:8000">http://localhost:8000</a> in your browser you should see the <em>Hello World!</em> front page.</p>
<p>If you aren&#8217;t using PHP 5.4, you will just need to create a new VirtualHost and point it to the <code>/public</code> directory of your project.</p>
<p>Now is a good time to commit your work to Git.</p>
<pre class="brush: bash; title: ; notranslate">
$ git add -A
$ commit -m &quot;Yay&quot;
</pre>
<p>Congratulations! You have just set up Laravel 4!</p>
<h2>About this series</h2>
<p>This is the first of a huge series on creating a web application from scratch. Over the course of many future weeks, I&#8217;m going to show you how to create a web application and everything that goes into it.</p>
<p>The application I&#8217;m going to create is going to be called <a href="http://cribbb.com">Cribbb</a>. I haven&#8217;t fully decided what it&#8217;s going to be yet, so I&#8217;m just letting the project find it&#8217;s own direction.</p>
<p>I&#8217;m going to be (obviously) using Laravel for all of the server side stuff and we&#8217;ll create a <a href="http://culttt.com/2013/04/15/what-are-restful-web-services/">RESTful API</a>.</p>
<p>I&#8217;m going to use <a href="http://emberjs.com/">Ember.js</a> for all of the client side stuff and we&#8217;ll be using <a href="http://culttt.com/2013/01/14/getting-started-with-sass/">Sass</a> and a lot more cool new front end stuff that you might not have used in a project before.</p>
<p>Hopefully this will be a good guide for going from an idea to a fully working web application as well as practical tutorials in getting started with some of the latest technology for building online products.</p>
<p>And all these tutorials will be free to web and all of the code will be open sourced on <a href="https://github.com/philipbrown/cribbb">GitHub</a>.</p>
<p>So if you have an idea for an online application, but you don&#8217;t know where to get started, follow along with this tutorial series as I show you everything you will need to do to create a modern web application.</p>
<p>Remember to follow Culttt on <a href="http://twitter.com/culttt">Twitter</a>, <a href="http://facebook.com/culttt">Facebook</a> or <a href="https://plus.google.com/105545788844824874492/posts">Google Plus</a> to make sure you never miss a tutorial!</p>
<p>See you next Monday!</p>
<p><a href="http://culttt.com/2013/04/29/getting-started-with-laravel-4/">Getting started with Laravel 4</a> was written by <a rel="author" href="http://culttt.com/author/philipbrown/">Philip Brown</a> on <a href="http://culttt.com">Culttt - Articles on business, technology and the Internet</a></p>]]></content:encoded>
			<wfw:commentRss>http://culttt.com/2013/04/29/getting-started-with-laravel-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Design Inspiration #82</title>
		<link>http://culttt.com/2013/04/26/design-inspiration-82/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=design-inspiration-82</link>
		<comments>http://culttt.com/2013/04/26/design-inspiration-82/#comments</comments>
		<pubDate>Fri, 26 Apr 2013 07:20:48 +0000</pubDate>
		<dc:creator>Philip Brown</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://culttt.com/?p=3031</guid>
		<description><![CDATA[<p>Design Inspiration from Bakken &#38; B&#230;ck, SumAll, Scoop, UXPin and DailyCost! Design Inspiration is a weekly post that showcases examples of some of the best new web design from around the internet. To submit to Design Inspiration, click the “submit” link at the bottom of the page and follow the instructions for submitting your site [...]</p><p><a href="http://culttt.com/2013/04/26/design-inspiration-82/">Design Inspiration #82</a> was written by <a rel="author" href="http://culttt.com/author/philipbrown/">Philip Brown</a> on <a href="http://culttt.com">Culttt - Articles on business, technology and the Internet</a></p>]]></description>
				<content:encoded><![CDATA[<p>Design Inspiration from Bakken &amp; B&aelig;ck, SumAll, Scoop, UXPin and DailyCost!</p>
<p>Design Inspiration is a weekly post that showcases examples of some of the best new web design from around the internet. To submit to Design Inspiration, click the “submit” link at the bottom of the page and follow the instructions for submitting your site or a site you wish to feature.</p>
<p><a href="http://www.bakkenbaeck.no/"><img src="http://culttt.com/wp-content/uploads/2013/04/Bakken-Baeck.jpg" alt="Bakken Baeck" /></a></p>
<h2>Bakken &amp; B&aelig;ck</h2>
<p><a href="http://www.bakkenbaeck.no/">http://www.bakkenbaeck.no</a></p>
<p><a href="https://sumall.com/"><img src="http://culttt.com/wp-content/uploads/2013/04/SumAll.jpg" alt="SumAll" /></a></p>
<h2>SumAll</h2>
<p><a href="https://sumall.com/">https://sumall.com</a></p>
<p><a href="https://helloscoop.com/"><img src="http://culttt.com/wp-content/uploads/2013/04/Scoop.jpg" alt="Scoop" /></a></p>
<h2>Scoop</h2>
<p><a href="https://helloscoop.com/">https://helloscoop.com</a></p>
<p><a href="http://uxpin.com/"><img src="http://culttt.com/wp-content/uploads/2013/04/UXPin.jpg" alt="UXPin" /></a></p>
<h2>UXPin</h2>
<p><a href="http://uxpin.com/">http://uxpin.com</a></p>
<p><a href="http://dailycost.com/"><img src="http://culttt.com/wp-content/uploads/2013/04/DailyCost.jpg" alt="DailyCost" /></a></p>
<h2>DailyCost</h2>
<p><a href="http://dailycost.com/">http://dailycost.com</a></p>
<p><a href="http://culttt.com/2013/04/26/design-inspiration-82/">Design Inspiration #82</a> was written by <a rel="author" href="http://culttt.com/author/philipbrown/">Philip Brown</a> on <a href="http://culttt.com">Culttt - Articles on business, technology and the Internet</a></p>]]></content:encoded>
			<wfw:commentRss>http://culttt.com/2013/04/26/design-inspiration-82/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

 Served from: culttt.com @ 2013-05-19 01:38:03 by W3 Total Cache -->