Page 23 of 23

Composer Private Repository Problems

Cross development can be a pain…

Recently I have been finding out the slight differences between Windows and Linux for use with Laravel and Composer. One difference is Windows isn’t picky about the way you set out Composer’s packages which can be a major problem. Here’s the issue I had and what I had to do to get it going…

{
    "name"
}: 
"laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"repositories": [
    {
        "type": "vcs",
        "url": "git@bitbucket.org:mbrookspulse8/admin.git",
        "url": "git@bitbucket.org:pulse8/haulfryn-admin-sliders.git",
        "url": "git@bitbucket.org:pulse8/haulfryn-admin-parks.git",
        "branches-path": false,
        "tags-path": false
    }
],
"require": {
    "laravel/framework": "4.1.*",
    "cartalyst/sentry": "2.1.*",
    "imagine/Imagine": "0.5.0",
    "edvinaskrucas/notification": "2.*",
    "way/generators": "dev-master",
    "pulse8/admin": "dev-master",
    "pulse8/sliders": "dev-master",
    "pulse8/parks": "dev-master",
    "geedmo/yamm3": "dev-master"
},
"autoload": {
    "classmap":
    [
        "app/commands",
        "app/controllers",
        "app/models",
        "app/database/migrations",
        "app/database/seeds",
        "app/tests/TestCase.php"
    ]
},
"scripts": {
    "post-install-cmd"
}:
[ "php artisan clear-compiled", "php artisan optimize" ],
"post-update-cmd": [ "php artisan clear-compiled", "php artisan optimize" ],
"post-create-project-cmd": [ key:generate" ] },
"config": {
    "preferred-install": "dist"
},
"minimum-stability": "stable"
}

As you can see, I placed all of my private VPS URLs into one JSON object. On Windows, everything was fine and dandy, nothing was overwritten and everything could be found easily. However, when I placed it all on the server, this is where I ran into problems. Linux is more strict on standards (which is definitely not a bad thing) and caused a lot of aches and pains for me as I wasn’t coding to these standards. It took me and my team a whole day to suss out what was wrong, but this was our finished code for the private VPS URLs…

"repositories": 
[
    { 
        "type": "vcs",
        "url": "git@bitbucket.org:mbrookspulse8/admin.git",
        "branches-path": false,
        "tags-path": false
    },
    {
        "type": "vcs",
        "url": "git@bitbucket.org:pulse8/haulfryn-admin-sliders.git",
        "branches-path": false,
        "tags-path": false
    },
    {
        "type": "vcs",
        "url": "git@bitbucket.org:pulse8/haulfryn-admin-parks.git",
        "branches-path": false, "tags-path": false
    }
],

They have been separated into their own object and now runs perfectly fine on Windows and Linux. Had similar issues? If so then please feel free to share and let me know how you overcame them.

Social Networking Website Based in Laravel

Laravel social networking website.

I’ve been wanting to make a social networking website for a long time, one which will rival the big guys. I also thought about maybe doing it following the footsteps of Mark Zuckerberg by recording my steps live on my Blog and get feedback to what others think. That way, I can create something which everyone wants and unleash something which almost everyone will love.

I will also release any tutorial worthy stuff as I go through my development to help anyone else who are thinking of making their own social networking sites using Laravel.

I’m starting out with the basics, such as: registration, messaging, pages etc.

What are your likes and dislikes about Facebook, Google+ and Twitter? Let me know in the comments so I can get some awesome feedback.

First Laravel Tutorial – Controllers and Routes

Commence quick and helpful tutorial…

Previously on a Laravel project, I had to have a slug within my routes which would point to two different tables within my database. I needed a controller which would do the thinking for me. And by this I mean, in my routes I would have…

Route::get('{slug}', 'URLController@index');

And in my Controller, I would have the following to do the thinking for me…

public function index($slug)
{
    if(Page::where('slug', $slug)) {
        //Show page property
    }
    else if(Blog::where('slug', $slug)) {
        //Show Blog property
    }
}

So here we have our logic saying if there is anything in the page table where the slug matches. We show the page with that slug otherwise, show a blog post with the matching slug.

This might not be the best example as a lot of people would have a blog post going to ‘blog/{slug}’ and you might even have the page go to ‘page/{slug}’, but the page structure of a site is always changing and it depends on how you feel people should view your site.

I have found one problem with this mind, if nothing gets found then it will just show a blank page, I haven’t found the good logic which will display errors. Or if you are in production a 404 page.

Brand New Website, Brand New Start

Here I go again, on my quest for a new website…

Of becoming a Web Master. It’s been a while since I properly posted on my Blog. And so I wondered the best way to go about this. As I went back to my old site and old Blog. I looked at it and I couldn’t help but think that the way of making templates on Blogger was a bit too tedious and slap-dashed and was in need of a new website.

Now I’m using Laravel at work and starting to feel like it is such a great tool to use. I felt like I should start my new site using a platform which embraces Laravel and so here I am, using WardrobeCMS.

From what I have seen so far, it bolts on some pretty nifty packages and creates something that is simple and elegant. Rather than HTML, it uses a markdown language which looks amazing and it’s so simple to use.

In the future, I hope to create my own theme for it and maybe even make some packages to enhance what is already becoming a lovely piece of kit. I also plan on doing a lot of tutorials focusing mainly on Laravel itself. And possibly some packages which I find useful through my journey.

#WatchThisSpace