bashy

DevOps/Lead Developer at :)

Member Since 5 Years Ago

London, UK

Experience Points
1,011,240
Total
Experience

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
779
Lessons
Completed
Best Reply Awards
476
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

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

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

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

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    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 Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

Level 50
1,011,240 XP
Jun
11
4 months ago
Activity icon

Replied to How To Protect Laravel Website?

I'm guessing you have modified the location of the index.php file and put it a level up from the default public folder? Doing that can expose all of the core files (vendor stuff) and depending on what packages you have install, that's probably it.

Activity icon

Replied to Horizon/Redis - Multiple Server Setup?

It really comes down to redundancy as you said. If you do run multiple queue servers, just remember to use ->onOneServer() as described here: https://medium.com/@taylorotwell/laravel-5-6-preview-single-server-scheduling-54df8e0e139b

Activity icon

Replied to WYSIWYG Blade Editor?

@elfeffe I doubt you can since it's a HTML editor (WYSIWYG)

Activity icon

Replied to Laravel 4.2 And Php 7.1 Issues With Carbon

Upgrade Laravel since 4.2 doesn't work well with PHP 7. And also don't bump 2 year old threads.

May
07
5 months ago
Activity icon

Replied to Session Lifetime

@babonday Thanks for 2 year old post tag.

Mar
07
7 months ago
Activity icon

Replied to 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
Mar
06
7 months ago
Activity icon

Replied to 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.

Mar
05
7 months ago
Activity icon

Replied to 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();
Mar
04
7 months ago
Activity icon

Replied to 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.

Feb
01
8 months ago
Activity icon

Replied to 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?

Jan
08
9 months ago
Activity icon

Replied to How Scripts (Linux Commands) Are Executed In Laravel Forge?

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

Nov
09
11 months ago
Activity icon

Replied to 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.

Nov
08
11 months ago
Activity icon

Replied to 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.

Nov
07
11 months ago
Activity icon

Replied to [BUG] Going Back Returns JSON

Fine in Firefox for me too.

Oct
09
1 year ago
Activity icon

Replied to 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?

Sep
25
1 year ago
Activity icon

Replied to 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.

Aug
22
1 year ago
Activity icon

Replied to Homestead TTFB > 2sec Issue .. Help

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

Aug
13
1 year ago
Activity icon

Replied to Class 'App\Http\Controllers\Redirect' Not Found

@LearnHunter Definition of useless reply :)

Aug
08
1 year ago
Activity icon

Replied to 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;
}
Aug
06
1 year ago
Activity icon

Replied to 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

Jul
30
1 year ago
Activity icon

Replied to 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.

Jul
18
1 year ago
Activity icon

Replied to Error On Safari. White Blank Page

Ok, worth a try :)

Activity icon

Replied to Error On Safari. White Blank Page

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

Activity icon

Replied to Cannot Migrate Database

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

Jun
27
1 year ago
Activity icon

Replied to 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.

Activity icon

Replied to To Send Multiple PDF Attachment In Single Mail

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

Jun
26
1 year ago
Activity icon

Replied to 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.

Activity icon

Replied to Return Year Count Even When Count Is 0

Could you do an array of the years and array_fill?

Activity icon

Replied to Retrieve Username Based On Id In Users Table

Yeah guess you would need that.

Activity icon

Replied to Signature Pad

Look at the jsfiddle link then.

Activity icon

Replied to Retrieve Username Based On Id In Users Table

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

Activity icon

Replied to To Send Multiple PDF Attachment In Single Mail

Where are the files you want to attach?

Activity icon

Replied to 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.

Activity icon

Replied to 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/

Activity icon

Replied to Signature Pad

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

Jun
25
1 year ago
Activity icon

Replied to 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>
Activity icon

Replied to Macbook Pro Vs Any Other Laptop With Ubuntu

@leonsegal Yup, thanks for the 3 year bump.

Jun
21
1 year ago
Activity icon

Replied to PhpMyAdmin On Forge

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

Jun
19
1 year ago
Activity icon

Replied to 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.

Activity icon

Replied to 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).

Activity icon

Replied to 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=)

Activity icon

Replied to How To Pass URL String As Parameter To Laravel Routing

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

Replied to 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?

Jun
04
1 year ago
Activity icon

Replied to 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?

Activity icon

Replied to 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.

May
18
1 year ago
Activity icon

Replied to 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?

May
16
1 year ago
Activity icon

Replied to Href For A Route In JavaScript

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

Activity icon

Replied to 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'
];
May
15
1 year ago
Activity icon

Replied to 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 :)