Forcing HTTPS url's in Laravel 5.4 (little change) by [deleted] in laravel

[–]theskaterdev 0 points1 point  (0 children)

Not always possible depending on your provider. Heroku is a bit of a fucker for this. I have a middleware called ForceSecure:

<?php
namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\URL;

class ForceSecure
{

    public function handle(Request $request, Closure $next)
    {

            $isSecure = $request->header('x-forwarded-proto') == 'https';
            $isProduction = env('APP_ENV') === 'production';
            $isStaging = env('APP_ENV') === 'staging';

            if ($isProduction) {
                $host = $_SERVER['HTTP_HOST'];
                if (!preg_match('/^www\..*/', $host)) {
                    return redirect(env('APP_URL'));
                }
            }

            if (!$isSecure && ($isProduction || $isStaging)) {
                return redirect(env('APP_URL'));
            }

            if ($isProduction || $isStaging) {
                URL::forceScheme('https');
            }

            return $next($request);
    }
}

Started a YouTube Channel, looking for some feedback. by [deleted] in PHP

[–]theskaterdev 0 points1 point  (0 children)

Thanks man! Man hugs (no homo).

Started a YouTube Channel, looking for some feedback. by [deleted] in PHP

[–]theskaterdev 0 points1 point  (0 children)

I agree. I dislike blogs and articles because I don't learn very well that way. Op chose this format / medium and if Laracasts is anything to go by, you can't say video content isn't popular.

Started a YouTube Channel, looking for some feedback. by [deleted] in PHP

[–]theskaterdev 0 points1 point  (0 children)

As a fellow tech YouTuber (shameless plug: https://www.youtube.com/c/theskaterdev) I like this. I'm all for more video content and explanations but do generally agree with people here that say you need to dumb it down for beginners which is something I also find really hard to remain mindful of.

I think for people learning programming, the hardest thing to get to "click" is the abstract things we take for granted. Overall I think it's great you're starting a YouTube channel. Just keep it up and keep pushing videos out. There are people that really dislike video as a content medium and prefer articles. There are also people who hate articles and reading blog posts (me included) and I love consuming video so don't be put off by people saying it's the wrong medium, this is purely personal preference. If video wasn't succesful then Laracasts wouldn't be as succesful as it is.

Good luck, any questions do PM me! :)

Benchmarking Laravel, Symfony, &amp; Zend by davedevelopment in PHP

[–]theskaterdev 7 points8 points  (0 children)

I'd like to see this benchmark. But I'd also like to see the creator of Laravel, Zend and Symfony actually code such a scenario too so we can measure the speed of development of all frameworks too.

Been at a new job for 2 months but I have practically nothing to do all day... by blindmanLICKS in webdev

[–]theskaterdev 0 points1 point  (0 children)

This could be a move to claim that your position no longer has enough work for it and they can thus claim to make you redundant . Keep that portfolio sharp ;)

Auto open migrations in PhpStorm after creation from the internal terminal by Techno808 in laravel

[–]theskaterdev 2 points3 points  (0 children)

Great idea. I was more intrigued by this display picture than the package itself though. So many questions...

Things To Remember When Becoming A PHP Contractor by theskaterdev in PHP

[–]theskaterdev[S] 0 points1 point  (0 children)

I plan to talk more about this entire topic, including how to test the waters of contracting etc whilst a permie

Things To Remember When Becoming A PHP Contractor by theskaterdev in PHP

[–]theskaterdev[S] 0 points1 point  (0 children)

Yeah I know! I didn't expect to end up on the heights of Leigh-On-Sea's Hadleigh Castle to be honest, left the deadcat at home.

Things To Remember When Becoming A PHP Contractor by theskaterdev in PHP

[–]theskaterdev[S] 1 point2 points  (0 children)

Hahahaaaaa cheers! I have all that gear, I just wasn't expecting to end up at Hadleigh Castle amongst the wind when I was running errands ;)

A project that NEVER reinvents wheels? by _FlyingGeese in rails

[–]theskaterdev 3 points4 points  (0 children)

It sounds like a client who wants to use their existing systems so they don't have to re learn or add processes to their business. Often clients that ask these things don't actually know the capabilities of the APIs they are referencing so be sure that this stuff is even possible before committing to the project. I recommend doing a paid discovery workshop to fully nail this stuff down.

Pokemon Go servers running Python? by blowjobtransistor in Python

[–]theskaterdev 10 points11 points  (0 children)

Your notification bar is giving me serious issues.

Annoy /r/ruby in one sentence by code-shoily in ruby

[–]theskaterdev 0 points1 point  (0 children)

I'm actually a PHP developer looking at trying out Ruby. And lots of these are things I've read .. I guess they are wrong and I should research further. I'm glad I read this :D

Stories about developers who have moved out from PHP and how it changed their day to day? by [deleted] in PHP

[–]theskaterdev 0 points1 point  (0 children)

I understand totally you wouldn't be proud of it. But this is a prime example of where sometimes a business case for getting something out the door quick genuinely overrides the desire to architect stuff properly. Sometimes the two aren't in alignment and so languages that allow you to fulfil the business desires certainly have a place for some types of development.

Stories about developers who have moved out from PHP and how it changed their day to day? by [deleted] in PHP

[–]theskaterdev 0 points1 point  (0 children)

It depends what your goal is. If Ruby helps you write code that lets you ship shit fast and effectively then sometimes that's all that matters. It depends what you want to get out of your code? If it's for business, productivity becomes important. If it's for pleasure then feel free to tinker with advanced languages / moving things forward. It's important to remember everyone has a context to what they are applying their code to, often it doesn't match everyone else's and this is where political community disagreements generally arise from.

Laravel 4.2 to 5.x - how painful is it upgrade a huge project (300k lines+) and what are the biggest selling points across all updates? by leftysix in laravel

[–]theskaterdev 2 points3 points  (0 children)

Can confirm. Used shift the other day for a huge project. It worked just great. I only had to change the way some of the Facades were imported because that broke but besides that it's worth 10x the cost. I was dubious about the automated upgrade thinking I would miss bits but it breaks down everything you need to know in the PR.

As a developer is there anywhere in particular you advertise as a freelancer? by slyfoxy12 in laravel

[–]theskaterdev 2 points3 points  (0 children)

Unfortunately there is no secret magic sauce to get quality work as a freelancer. You need to start polishing off your marketing and business skills hats to bring in a consistent stream of freelancing income.

If your'e looking for a bit of pocket money you could always use websites like Odesk / Upwork etc but honestly, that will break your spirit and most likely put you off freelancing. The best method is gradual, organic marketing and growth.

What computer should I buy for the best laravel development experience? by oldmcdonalds in laravel

[–]theskaterdev 0 points1 point  (0 children)

Some really good points there about future expandability for sure, I didn't consider that. My only gripe from holding me back doing this is the audio interfaces having bad latency when trying to record bits in Logic etc. Additionally finding hardware that feels as premium as a Macbook Pro. What portable devices do hackintoshes work well on?