bashy

Member Since 5 Years Ago

London, UK

DevOps/Lead Developer at :)

Experience Points 1,009,900
Experience Level 50

0 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 777
Lessons
Completed
Best Reply Awards 476
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

07 May
1 week ago

bashy left a reply on Session Lifetime

@babonday Thanks for 2 year old post tag.

07 Mar
2 months ago

bashy left a reply on Recommended Redis Version

Where did you get 3.6 from? Looks like Debian 9 has redis-server 3.2.6 https://packages.debian.org/stretch/redis-server

I'm on Stretch (deb9) and use 3.2.6

$ redis-server --version
Redis server v=3.2.6
06 Mar
2 months ago

bashy left a reply on Eager Loading BelongsTo Relationship

dd() your data first to check you're getting data within the relation. Then you can see how you'll need to get it within JS.

05 Mar
2 months ago

bashy left a reply on Eager Loading BelongsTo Relationship

Not sure how you're using it within vue.js but maybe a weird way;

$productCategories = ProductCategory::with('products.productcategory')->get();
04 Mar
2 months ago

bashy left a reply on Is This A Good Way To Include The Previous And Next Record?

@sharjeel That's only to show the buttons, not to get the previous and next data.

01 Feb
3 months ago

bashy left a reply on Allow Certain IP Addresses And Redirect The Rest In Nginx And Forge

@futureweb Just tested what I've put above and it's still working fine on nginx/1.15.8

Have you tried without the include?

08 Jan
4 months ago

bashy left a reply on How Scripts (Linux Commands) Are Executed In Laravel Forge?

Forge uses SSH connections to your server(s) and runs pre-defined commands (maybe bash scripts) though it.

09 Nov
6 months ago

bashy left a reply on Laravel Nginx PHP FPM Error, Permission Denied 13

Doesn't matter what the owner/group is really. What does this show?

ls -lah index.php

You can always do chmod 644 index.php if it's not readable for owner/group. Also make sure your webserver is running under www-data. Most of the time nginx uses nginx user.

08 Nov
6 months ago

bashy left a reply on Blade If Else On Single Line

@guntarsv I wouldn't worry about the performance of that vs shorthand if else. But you should use ?? as Cronix pointed out. It's been changed from Blade to native PHP.

07 Nov
6 months ago

bashy left a reply on [BUG] Going Back Returns JSON

Fine in Firefox for me too.

09 Oct
7 months ago

bashy left a reply on Old Password Validation

@yaroslawww You do know this is 2 years old and in that version it wasn't like that? Any need to reply?

25 Sep
7 months ago

bashy left a reply on Security Hardening For A Forge On Digital Ocean Setup

Some of it is very opinionated as well. Using a firewall to only open certain ports is good but Linux is very secure itself anyway. It's mostly down to software that's installed.

Things like memcached can listen on all interfaces so people can post stuff directly to it without a password for example.

22 Aug
8 months ago

bashy left a reply on Homestead TTFB > 2sec Issue .. Help

@robjbrain Sounds like your DB server is slow - which is the biggest cause of this problem.

13 Aug
9 months ago

bashy left a reply on Class 'App\Http\Controllers\Redirect' Not Found

@LearnHunter Definition of useless reply :)

08 Aug
9 months ago

bashy left a reply on How To Setup Nginx With Dnsmasq To Make It Work Like Valet On MacOS?

I use this for LaraDock nginx

server {

    listen 80;
    listen [::]:80;

    server_name ~^(?<domain>[^.]+)\.(?<tld>[^.]+)$;

    root /var/www/$domain/public;
    index index.php;

    location / {
         try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.php$ {
        try_files $uri /index.php =404;
        fastcgi_pass php-upstream;
        fastcgi_index index.php;
        fastcgi_buffers 16 16k;
        fastcgi_buffer_size 32k;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        #fixes timeouts
        fastcgi_read_timeout 600;
        include fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }

    location /.well-known/acme-challenge/ {
        root /var/www/letsencrypt/;
        log_not_found off;
    }

    error_log /var/log/nginx/$domain-error.log;
    access_log /var/log/nginx/$domain-access.log;
}
06 Aug
9 months ago

bashy left a reply on How To Setup Nginx With Dnsmasq To Make It Work Like Valet On MacOS?

Just follow what Valet does in this file: https://github.com/laravel/valet/blob/master/cli/Valet/DnsMasq.php

echo 'address=/.test/127.0.0.1' > /usr/local/etc/dnsmasq.conf

Here's some info for that: https://gist.github.com/ogrrd/5831371

30 Jul
9 months ago

bashy left a reply on Laravel Framework File Permission - Security

@SimonEsposito That's why ACL is best since it'll allow you to set who can read/write/execute and doesn't matter about owner/group.

18 Jul
10 months ago

bashy left a reply on Error On Safari. White Blank Page

Ok, worth a try :)

bashy left a reply on Error On Safari. White Blank Page

Is this a polyfill issue? https://polyfill.io

bashy left a reply on Cannot Migrate Database

What MySQL server version you using? They've changed the authentication method in newer versions and it's not great.

27 Jun
10 months ago

bashy left a reply on To Send Multiple PDF Attachment In Single Mail

Can't use attachData if it's a file. You can't actually use a http link either. You should use the public_path('assets/img/form.pdf') way.

bashy left a reply on To Send Multiple PDF Attachment In Single Mail

Just do another $message->attach() method...?

26 Jun
10 months ago

bashy left a reply on Return Year Count Even When Count Is 0

@Artak I'm guessing some months won't have values in the database so they need to fill 2000, 2001, 2002 etc that don't have values.

bashy left a reply on Return Year Count Even When Count Is 0

Could you do an array of the years and array_fill?

bashy left a reply on Retrieve Username Based On Id In Users Table

Yeah guess you would need that.

bashy left a reply on Signature Pad

Look at the jsfiddle link then.

bashy left a reply on Retrieve Username Based On Id In Users Table

@wilk_randall You probably want the $table->primary() to be $table->index()?

bashy left a reply on To Send Multiple PDF Attachment In Single Mail

Where are the files you want to attach?

bashy left a reply on How To Escape Double Curly Braces In A Blade Template?

@RoboRobok Well hopefully anpel hasn't had a bug in their code for a year+

Better late than never I guess.

bashy left a reply on Signature Pad

Yeah well, after that code you need your customised stuff for how you're saving it. You said you already know how to save it?

https://jsfiddle.net/aq9Laaew/56575/

bashy left a reply on Signature Pad

You'll need to show some code and some sort of screenshot so we can see.

25 Jun
10 months ago

bashy left a reply on Signature Pad

All you do is add an input and use the provided JS?

<div id="signature-pad" class="m-signature-pad">
    <div class="m-signature-pad--body">
        <canvas style="border: 2px dashed #ccc"></canvas>
    </div>

    <div class="m-signature-pad--footer">
        <button type="button" class="btn btn-sm btn-secondary" data-action="clear">Clear</button>
        <button type="button" class="btn btn-sm btn-primary" data-action="save">Save</button>
    </div>
</div>


<script>
    $(function () {
        var wrapper = document.getElementById("signature-pad"),
        clearButton = wrapper.querySelector("[data-action=clear]"),
        saveButton = wrapper.querySelector("[data-action=save]"),
        canvas = wrapper.querySelector("canvas"),
        signaturePad;

        // Adjust canvas coordinate space taking into account pixel ratio,
        // to make it look crisp on mobile devices.
        // This also causes canvas to be cleared.
        window.resizeCanvas = function () {
            var ratio =  window.devicePixelRatio || 1;
            canvas.width = canvas.offsetWidth * ratio;
            canvas.height = canvas.offsetHeight * ratio;
            canvas.getContext("2d").scale(ratio, ratio);
        }

        resizeCanvas();
    });
</script>

bashy left a reply on Macbook Pro Vs Any Other Laptop With Ubuntu

@leonsegal Yup, thanks for the 3 year bump.

21 Jun
10 months ago

bashy left a reply on PhpMyAdmin On Forge

I can't give any updates since I've not used it since. What problems you having?

19 Jun
11 months ago

bashy left a reply on How To Pass URL String As Parameter To Laravel Routing

It's because you're putting a URL into a URL... you need to urlencode() it. No way around it.

bashy left a reply on Best Guides To Deploying Laravel In Sharedhosting

5.6 requires >= 7.1.3 so 7.0 won't work and it's probably something like two question marks that's causing the error (because it's built for newer PHP versions).

bashy left a reply on How To Pass URL String As Parameter To Laravel Routing

Well you didn't really explain much about where it was coming from.

If the user adds in the full URL to the video, you need to parse that input and take the ID after v=.

$video_id = str_after($request->input('v'), 'watch?v=');

Although having the user submit it via query string will cause it to parse it wrong (double ?v=)

bashy left a reply on How To Pass URL String As Parameter To Laravel Routing

<a href="{{ url('watch', ['v' => 'youtubeId']) }}">Watch Video</a>

bashy left a reply on Is There An Easy Way To Load And Save Configs ?

@hshahdoost Sure, but as soon as someone requests a page and they're not in the cache, they will be added again. You can run jobs to rebuild this on clearance I guess?

04 Jun
11 months ago

bashy left a reply on Is It Possible To Feed The Envoy.blade.php File With Data From DB ?

@itsmill3rtime Have you ever thought that maybe that wasn't possible 3 years ago?

bashy left a reply on Hosting On Shared Server Best Practice

@doni49 Linux is very secure by default. Obviously the more packages you install, the more security risk there is but all you have to do is install/change a few things to make it secure then it's just a matter of sudo apt upgrade for updates.

31 May
11 months ago
18 May
1 year ago

bashy left a reply on Laravel 5 Validation Request, How To Handle Validation On Update?

@sghimire Then put the rule of sometimes? You didn't say you wanted it to be an optional field?

16 May
1 year ago

bashy left a reply on Href For A Route In JavaScript

How do you put the 'route'? What route?

bashy left a reply on Laravel 5 Validation Request, How To Handle Validation On Update?

@sghimire You will need to do two rules for it;

protected $rules = [
    'title' => 'required|string|max:255',
    'slug' => 'required|alpha_dash|min:5|max:255|unique:posts,slug',
    'image' => 'sometimes|image',
    'category_id' => 'required|integer',
    'reports' => 'required',
    'reports.*.report_type_id' => 'required|integer'
];
15 May
1 year ago

bashy left a reply on Thanks And Farewell

@endian Yeah something like that. It's currently built in Python and working so when I get some free time, I'll be looking into it more :)

bashy left a reply on Thanks And Farewell

Yeah nodejs is fun. I've been looking at something micro for an API that I don't want to setup a web server + php on each server.

11 May
1 year ago

bashy left a reply on SSL Issue With Laravel On Production Server Using Apache

Do you use a proxy? Laravel will write the URLs with the same protocol it reads from the server headers. If it's returning HTTP, it means it sees HTTP (usually a reverse proxy).

You will need to force the protocol to HTTPS as lostdreamer_nl stated.

bashy left a reply on Shared Hosting

Did you upload the vendor folder from local? Composer caches the file paths.