Subdomain testing in Laravel

Standard

Learning about automated testing and implementing is great. Unfortunately some projects I work on are multi tenant, and each client has it’s own subdomain. I then have an “app” subdomain with separate routes on it for things like API, or switching tenants if you belong to multiple of them. You may find a few articles that say to just use $this->call() instead of $this->get() or $this->post(). It really is that simple.

I use a domain like lvh.me which points to 127.0.0.1 along with it’s subdomains.

Here is my setup:

App: app.lvh.me
Tenant App Example 1: test1.lvh.me
Tenant App Example 2: my-company.lvh.me

Example routes.php file

//app domain routes
$router->group(['domain' => 'app.lvh.me'], function($router) {
    $router->post('register', 'App\RegisterController@store');
});
 
//tenant routes
$router->group(['domain' => '{account}.lvh.me'], function($router) {
    $router->post('login', 'Tenant\LoginController@store');
});

To test the login route for the Tenant App Example 1 we do:

$this->call('POST', 'http://test1.lvh.me', ['email' => 'test@example.com', 'password' => 'mysecretpassword']);

To login to Tenant App Example 2, we would do:

$this->call('POST', 'http://my-company.lvh.me', ['email' => 'test@mycompany.com', 'password' => 'mycompanypassword']);

For routes on our App domain we do:

$this->call('GET', 'http://app.lvh.me/register');

Interviewing for a Job in the Adult Entertainment Industry

Standard

Late last year I had a recruiter contact me for a web developer position working at one of the major adult entertainment industry companies. Interesting I thought. Would I take the position if I got it, I don’t know. Would you? The salary was between $90k – $95k. Very tempting!

They were looking specifically for Laravel developers in this area and I guess that list is pretty short. I have had several other recruiters contact me for other positions because I am a Laravel developer so it’s a growing trend here.

This office was located in one of those “office park” type areas. Multiple office spaces in a building with several more buildings near by. The biggest thing I noticed was a security system on the doors. As I waited in the lobby numerous employees all going in and out putting their RFID badges near the reader. At first I thought this was weird, but with the kind of content this company puts out, they might get some crazies from time to time. Postal 2 anybody?

The interview was like most others. You chat and get to know each other. They ask some technical questions, you ask your questions, yadda yadda yadda. One question they asked that I had not heard before was “Will your family be ok with it?”. Some will, sure, some won’t but at the end of the day, they don’t pay my mortgage (or rent at the time) so they don’t get a say in it.

After the q/a session we went around and they showed me the office and where the developers were. I was a bit surprised to see the setup. 4 or 5 people cramped into a tiny office. We don’t need a lot of space but if you are claustrophobic, this area isn’t good for you. I don’t recall seeing any windows in there. Then we continued walking around the entire office space. The video editing team is out in the middle. Think of setting up cubicles on a basketball floor. To the right of us are these giant windows with blue lights glowing. A massive server room. I wanted to go in, but it didn’t happen. Boo!

The biggest thing I learned is there are various degrees of “X” rated films.

At the end, I didn’t get the job. I wasn’t to bummed by it as I liked my current job anyways. Plus, it’s always good to increase your interview skills and makes for a good story.

Why It’s Good to Apply to Multiple Jobs

Standard

Shaking hands at job When I was looking for a job I had applied to quite a few positions. Several lead to phone interviews, and a little less than that lead to in-person interviews.

The place I landed at (company A), I had applied to a few weeks before hearing a response back. During that time I had done a few other interviews. One had been over the phone with another media company (company B) here in town. I didn’t hear back from them and it was a lot of WordPress stuff so I wasn’t particularly thrilled with that. When company A got back with me we did an interview and then the next day another to meet the owner of the company. They explained to me what the job was, who their client base was, the benefits etc. Lastly, they explained they wanted to do a contract job to make sure I could do it before hiring me. The project was still in the design stage they would get back to me with the details soon.

The next week or so, the same person from company B called me back. He had forgot he already called me once but this time it was for an in person interview. No problem as I live within 2 miles of their offices. An hour later, company A mentioned they would like the contract-to-hire to start ASAP. As someone who had been looking for a job for a little while, could this get any better? I let them know that the following Monday would be the best and that I have an interview with another company (company B) this Thursday but I wasn’t sure if I would take the company B position if offered.

What came next was quite the shocker. Minutes later I got a response back asking if I was offered the job right now (hired, no contract work), would I cancel my interview? Even though it was a risk, I said yes. Once I got the employment agreement and made sure everything was as expected I fired off an email to company B canceling my interview. So by applying to multiple jobs, you might be able to get a better offer when finding that perfect place.

Image courtesy of stockimages / FreeDigitalPhotos.net

Book: Raving Fans

Standard

Raving Fans Cover Raving Fans is a book written by Ken Blanchard and Sheldon Bowles about creating customers that rave about you in a good way.

The book combines 3 common lessons about building your fans. By putting them together it will create that loyalty you look for and even get free advertising by way of word-of-mouth.

What I really liked about this book is that it wasn’t written how I expected. It’s a story about an area manager who gets assigned a fairy godmother who helps teach him these three lessons. I was expecting more of a narration style saying “you should do this” or “you should do that”. Writing it as a story allows you to connect with the character. When something so simple finally clicks you don’t feel dumb as the conversation wasn’t to you. It was to another character in the book and for them to understand, meanwhile you are passively learning about this same thing.

Decide what you want

The first is deciding what you want. Do you want to be the most profitable business in niche? Do you want to have the bets customer service? Before you can move on you must know what you want your business to be. Without the vision your customers will drive your business into what it becomes.

Discover what the customer wants

The second is knowing what your customers want. How can your customers be a fan if you are solving the wrong problems? If they find speed more important than quality you probably shouldn’t spend a few hours determining the right font to use. If it was reversed, you definitely want to spend the time to get font just right. If your customer wants something you don’t want to provide you may have to let them go. You can fire a client or even better have them work with someone else on that one project.

These days when you go buy a computer they are all pretty close to the same. Sure the name on the case is different but spec wise they are similar. What really sets Dell apart from HP is their customer service. Years ago when doing IT, it was always a good experience working with the local technicians that Dell outsourced to. HP on the other hand was a pain. After going through all the steps HP would finally send us a box to ship it back to them. One particular laptop that I sent to HP was there for over 6 months just sitting there.

Deliver plus one

The third lesson is delivering on expectations plus one percent. We all like to go above and beyond for our customers but when we go to far beyond bad things happen. In the book they use an example of a gas station who will also wash your windshield. At one point they started doing all the windows because what customer wouldn’t want that right? The issue was that this gas station hadn’t yet mastered the windshield so they missed a spot. So they went above and beyond but failed at the expected part. Unfortunately we remember problems better than praises. So, this once percent is about doing just a little more. You start out pumping the customers gas. Once you have that mastered move on to washing the windshield. When you have that process down add something else, like the rear windshield, air up the tires or anything else. Just don’t do it all at once because it improves the likeliness you fail at some part due to the sudden increase of responsibility.

By the way, Barnes and Noble is selling this book for $1.99.

Combining Feeds

Standard

At work we are building this inventory aggregate system.  Every dealer has some sort of inventory management software be it online or offline. With this project we are working with those software vendors to display a dealers inventory on the manufacturers website. There was already an existing in place built years ago with only a few feeds available. It was also built in Ruby on Rails which would not be compatible with the new effort.

What I have found is that many of these software companies have already solved this issue. Either their own systems offer a website that works in similar fashion or other companies have come to them to build a feed aggregator but not necessarily for a manufacturer.

With the online feeds we are able to go out and grab an XML feed and pull in inventory. The way the offline systems solved this issue is by running scheduled tasks to create a file and the FTP it to the requested server.

Thankfully these software vendors have been nice to work with. Some have built the feeds specifically for us to use while others have provided support to using their API or explaining the process for getting the file uploaded.

While going through a sample XML file provided by one vendor I came across this “option” for a particular unit. It only costed an extra $56.00.

Inflatable Doll In Closet

We got a good laugh at that. I did have to go through the file and remove 5 more of these. It would be really bad for the client to see this in a demo. The vendor has also removed those bits from their example file. It makes me wonder if any other company has been given this file and found those entries.

Podcasts I Listen To

Standard

I like talk radio. In the mornings I listen to a morning show instead of music. At work I listen to several podcasts as it helps me focus. Unfortunately I end up binging on them so most days there isn’t a new episode to listen to. Here is the list of podcasts I currently listen to.

Radiolab * This is by far my favorite.
Jay & Silent Bob Get Old
Tell ‘Em Steve-Dave
Laravel.io
Improve Photography
Larry Uncensored Podcast

I also run ActivePodcast which is a free podcast discovery network.

What podcasts do you subscribe to?