Tuesday, April 19, 2016

Run Laravel Migrate on shared hosting

Hello everyone,

Had a project where we were using Laravel to build a small website. Turns out it is hosted on "shared hosting" without SSH to run command line commands to use Migrations or Seed.

After some research on the web, I found you can run the console commands from within routes. But this means having a route that could potential screw up the site.

But since it was possible I put together a tiny script that setup the console and runs the commands:

Now all that is needed it so upload the install.php script into the public folder, call it with www.my-site-url.com/install.php, and after it is finish delete it.

It's very important that the file is deleted after finishing.

You can find here how to configure Laravel on shared hosting. It's for version 4 but still applies to version 5.

Tuesday, April 12, 2016

How to add a Local Nuget package source to Visual Studio 2015

I was dabbling with Nuget, creating some packages and at a certain point I needed to add as a dependency on of my very own, unreleased (meaning unpublished at Nuget.org) packages.

Almost by accident I stumbled upon a solution, and since I haven't really blogged much here it is and hopefully it'll help others:


Go to Tools > Options, on the left side explorer Find Nuget Package Manager and expand it.
Next select the Package Sources.

In the right side panel, 

press the "add" button (1), 
give it a descriptive name (2), 
search for the directory that contain the packages (3),
press Update (4)




After that you should be able to install packages present on that directory.
This allows you to create packages and test how they work, without having to upload them to Nuget.org straight away.

Have fun.