{"id":140,"date":"2013-08-04T16:18:57","date_gmt":"2013-08-04T16:18:57","guid":{"rendered":"https:\/\/www.joetannorella.com\/?p=140"},"modified":"2013-08-04T16:18:57","modified_gmt":"2013-08-04T16:18:57","slug":"some-laravel-gotchas-things-to-take-note-of-when-starting-out-with-laravel","status":"publish","type":"post","link":"https:\/\/www.joetannorella.com\/some-laravel-gotchas-things-to-take-note-of-when-starting-out-with-laravel\/","title":{"rendered":"Some Laravel “Gotcha’s” – Things to take note of when starting out with Laravel"},"content":{"rendered":"

I am not a Laravel expert.<\/strong>\u00a0I am writing this blog post as a Laravel amateur<\/strong>. My goal with this is to point other newbies in the right direction with some seemingly common and easily avoided Laravel mistakes. I’ve only been using it for about a week, but I can’t help but think that if I myself had a list of “Gotcha’s” prior to starting out with the framework, maybe I’d be deploying on day 5 instead of day 7.<\/p>\n

Despite Laravel’s documentation being pretty good, there are a number of things you need to watch out for if you’ve never used it before.<\/p>\n

1) Deploying with GIT? Your Laravel site will not work!<\/h2>\n

This one really got to me and took me a while to figure out. Now I know about it it’s ridiculously easy to avoid, but debugging this one took me a good (or bad!) few hours.<\/p>\n

Problem:<\/h3>\n

The \/vendor\/ directory of Laravel is ignored with .gitignore file(s). When you deploy to your live server via git, you’re going to get an ugly error and generally have a bad time.<\/p>\n

Solution:<\/h3>\n

You have a few choices here. What I’ve decided to do is simply recursively remove all the .gitignore files from the \/vendor\/ directory. This means they then are included in your next local git commit, and thus on your next pull should be pulled down to the live server.<\/p>\n

The “proper” way of solving this issue is by utilising the composer system and running “composer install” and then “composer update” on future deployments.<\/p>\n

Another way of getting around this issue is to FTP every time. But I’m not going to recommend this \ud83d\ude42<\/p>\n

Recommended reading:<\/h3>\n

http:\/\/forums.laravel.io\/viewtopic.php?id=9814<\/p>\n

___<\/p>\n

More gotchas coming soon!<\/p>\n","protected":false},"excerpt":{"rendered":"

I am not a Laravel expert.\u00a0I am writing this blog post as a Laravel amateur. My goal with this is to point other newbies in the right direction with some seemingly common and easily avoided Laravel mistakes. I’ve only been using it for about a week, but I can’t help but think that if I…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"yoast_head":"\nSome Laravel "Gotcha's" - Things to take note of when starting out with Laravel - JoeTannorella.com<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.joetannorella.com\/some-laravel-gotchas-things-to-take-note-of-when-starting-out-with-laravel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Some Laravel "Gotcha's" - Things to take note of when starting out with Laravel - JoeTannorella.com\" \/>\n<meta property=\"og:description\" content=\"I am not a Laravel expert.\u00a0I am writing this blog post as a Laravel amateur. My goal with this is to point other newbies in the right direction with some seemingly common and easily avoided Laravel mistakes. I’ve only been using it for about a week, but I can’t help but think that if I...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.joetannorella.com\/some-laravel-gotchas-things-to-take-note-of-when-starting-out-with-laravel\/\" \/>\n<meta property=\"og:site_name\" content=\"JoeTannorella.com\" \/>\n<meta property=\"article:published_time\" content=\"2013-08-04T16:18:57+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.joetannorella.com\/some-laravel-gotchas-things-to-take-note-of-when-starting-out-with-laravel\/\",\"url\":\"https:\/\/www.joetannorella.com\/some-laravel-gotchas-things-to-take-note-of-when-starting-out-with-laravel\/\",\"name\":\"Some Laravel \\\"Gotcha's\\\" - Things to take note of when starting out with Laravel - JoeTannorella.com\",\"isPartOf\":{\"@id\":\"https:\/\/www.joetannorella.com\/#website\"},\"datePublished\":\"2013-08-04T16:18:57+00:00\",\"dateModified\":\"2013-08-04T16:18:57+00:00\",\"author\":{\"@id\":\"https:\/\/www.joetannorella.com\/#\/schema\/person\/84eafed4ad6cd6934b006e371c06c7ae\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.joetannorella.com\/some-laravel-gotchas-things-to-take-note-of-when-starting-out-with-laravel\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.joetannorella.com\/#website\",\"url\":\"https:\/\/www.joetannorella.com\/\",\"name\":\"JoeTannorella.com\",\"description\":\"Web Development | Digital Marketing | Business\/Startups | Analytics\/data\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.joetannorella.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.joetannorella.com\/#\/schema\/person\/84eafed4ad6cd6934b006e371c06c7ae\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.joetannorella.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/257001162d06da1a465f242dfa80dd7b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/257001162d06da1a465f242dfa80dd7b?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"url\":\"https:\/\/www.joetannorella.com\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Some Laravel \"Gotcha's\" - Things to take note of when starting out with Laravel - JoeTannorella.com","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.joetannorella.com\/some-laravel-gotchas-things-to-take-note-of-when-starting-out-with-laravel\/","og_locale":"en_US","og_type":"article","og_title":"Some Laravel \"Gotcha's\" - Things to take note of when starting out with Laravel - JoeTannorella.com","og_description":"I am not a Laravel expert.\u00a0I am writing this blog post as a Laravel amateur. My goal with this is to point other newbies in the right direction with some seemingly common and easily avoided Laravel mistakes. I’ve only been using it for about a week, but I can’t help but think that if I...","og_url":"https:\/\/www.joetannorella.com\/some-laravel-gotchas-things-to-take-note-of-when-starting-out-with-laravel\/","og_site_name":"JoeTannorella.com","article_published_time":"2013-08-04T16:18:57+00:00","author":"admin","twitter_misc":{"Written by":"admin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.joetannorella.com\/some-laravel-gotchas-things-to-take-note-of-when-starting-out-with-laravel\/","url":"https:\/\/www.joetannorella.com\/some-laravel-gotchas-things-to-take-note-of-when-starting-out-with-laravel\/","name":"Some Laravel \"Gotcha's\" - Things to take note of when starting out with Laravel - JoeTannorella.com","isPartOf":{"@id":"https:\/\/www.joetannorella.com\/#website"},"datePublished":"2013-08-04T16:18:57+00:00","dateModified":"2013-08-04T16:18:57+00:00","author":{"@id":"https:\/\/www.joetannorella.com\/#\/schema\/person\/84eafed4ad6cd6934b006e371c06c7ae"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.joetannorella.com\/some-laravel-gotchas-things-to-take-note-of-when-starting-out-with-laravel\/"]}]},{"@type":"WebSite","@id":"https:\/\/www.joetannorella.com\/#website","url":"https:\/\/www.joetannorella.com\/","name":"JoeTannorella.com","description":"Web Development | Digital Marketing | Business\/Startups | Analytics\/data","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.joetannorella.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.joetannorella.com\/#\/schema\/person\/84eafed4ad6cd6934b006e371c06c7ae","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.joetannorella.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/257001162d06da1a465f242dfa80dd7b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/257001162d06da1a465f242dfa80dd7b?s=96&d=mm&r=g","caption":"admin"},"url":"https:\/\/www.joetannorella.com\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.joetannorella.com\/wp-json\/wp\/v2\/posts\/140"}],"collection":[{"href":"https:\/\/www.joetannorella.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.joetannorella.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.joetannorella.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.joetannorella.com\/wp-json\/wp\/v2\/comments?post=140"}],"version-history":[{"count":0,"href":"https:\/\/www.joetannorella.com\/wp-json\/wp\/v2\/posts\/140\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.joetannorella.com\/wp-json\/wp\/v2\/media?parent=140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.joetannorella.com\/wp-json\/wp\/v2\/categories?post=140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.joetannorella.com\/wp-json\/wp\/v2\/tags?post=140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}