Braunson

Founder at Geekybeaver

Member Since 6 Years Ago

Ontario, Canada

Experience Points
33,095
Total
Experience

1,905 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
121
Lessons
Completed
Best Reply Awards
39
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 7
33,095 XP
Jan
12
1 week ago
Activity icon

Replied to A Tale As Old As Time Error:500

Have you tried enabling debug and seeing what the error for the 500 is? That may give you insight into the cause of the issue.

Jan
07
1 week ago
Activity icon

Replied to Why Nobody Cares About Developer's Convenience?

I've worked with some crazy environment setups from teams, all the way from multiple developers simultaneously editing live production sites via FTP as "version controlled" (absolutely insane), to some odd long building or very broken development pipelines.

I don't claim to have a perfect setup but I include a pre-set Laravel Homestead box in my git repository with my project, it takes 1-2 mins to go from 'Clone Repo' to 'Visit https://project.test' and begin developing, create a new branch, commit to git, create a PR and boom, next. Literally 0 setup, and I feel that's how it should be, simple to get up and running for new and experienced developers alike.

Sure it may have taken me a few hours initially to setup this environment but now I can easily re-use it for other projects with minimal changes.

I think once the initial developers are up and running, they do not care. It's working no issue for them, the new guy is on his own, 'it works'. It's really a concern and should be an area of focus for teams especially.

Perhaps onboarding new developers isn't a main pain point or isn't a concern but it really is when your the new guy on the team or if you are already on the team, you have to spend your time helping the new guys setup his environment.

I guess it's one of those things that are overlooked and should be taken more seriously. #youhaveagoodpoint

Jan
03
2 weeks ago
Activity icon

Awarded Best Reply on Artisan Exit Codes?

1 = failing / failed

2 = not ready

0 = success / no error....

More edit codes and definitions here https://www.tldp.org/LDP/abs/html/exitcodes.html

Activity icon

Replied to Artisan Exit Codes?

1 = failing / failed

2 = not ready

0 = success / no error....

More edit codes and definitions here https://www.tldp.org/LDP/abs/html/exitcodes.html

Dec
30
2 weeks ago
Activity icon

Replied to Routes Not Working In Hosted App

Check to make sure MOD_REWRITE is enabled on your server..

Dec
28
3 weeks ago
Activity icon

Replied to Tuning Argon2id Hash Options To Your Server

On that same PHP docs page, you can see this..

Supported options for PASSWORD_ARGON2I and PASSWORD_ARGON2ID:

Which explains the supported options are memory_cost, time_cost and threads. Which leads me to believe t = threads.

So instead of your code, using PASSWORD_BCRYPT replace it with PASSWORD_ARGON2ID. Then you can pass the options (above) in,.

Dec
20
4 weeks ago
Activity icon

Awarded Best Reply on Notifications Build Success

If I understand correctly, you are not receiving the build notification popup after running npm run dev is likely because your running it inside a server/vm.

By default build notifications are enabled. https://laravel-mix.com/docs/5.0/os-notifications

If you were to instead run npm run dev on the machine your using it should work. IF you are being told npm run dev doesn't exist, then you need to post more info (i.e. your not in the right folder, do not have NPM installed)

For example: My workspace is using Laravel Homestead (VirtualBox VM) in Windows. I run npm run dev on Windows and get the notification, however my code is served/run on Homestead.

Hope that helps.

Dec
19
1 month ago
Activity icon

Replied to AWS Image Display Permissions Issue

Could be your uploaded file/bucket's visibility isn't set to public..

Activity icon

Replied to Search Query In Serialize Data

Not sure why you are serializing it. Why not use json? Laravel support searching within json. If you need to search serialized data, you could try using like in the query but it's obviously not ideal.

Searching json columns using Eloquent (example):

 Products::query()->where('name->en','some text') 
Activity icon

Replied to Notifications Build Success

If I understand correctly, you are not receiving the build notification popup after running npm run dev is likely because your running it inside a server/vm.

By default build notifications are enabled. https://laravel-mix.com/docs/5.0/os-notifications

If you were to instead run npm run dev on the machine your using it should work. IF you are being told npm run dev doesn't exist, then you need to post more info (i.e. your not in the right folder, do not have NPM installed)

For example: My workspace is using Laravel Homestead (VirtualBox VM) in Windows. I run npm run dev on Windows and get the notification, however my code is served/run on Homestead.

Hope that helps.

Activity icon

Replied to Electronic Proof Of Delivery

Are you talking about proof of email delivery or just in general proof of delivery of say a package or anything? Can you give more details?

Activity icon

Replied to Logout Users From Other Devices

You can inject the user like so.. (i.e using a foreach loop of your users)

Auth::setUser($user)->logoutOtherDevices($user->password);

logoutOtherDevicesallows you to invalidate all other sessions for a users account.

Activity icon

Replied to Forever Plan Badge Is Gone

Yep also noticed after the deploy yesterday or the day previously.

Dec
18
1 month ago
Activity icon

Replied to Tracking Facebook Lite User

HTTP_REFERER is not a mandatory HTTP header. Many sites spoof/remove it. Apparently so does Facebook.

Here's an engineering article from FB https://www.facebook.com/notes/facebook-engineering/protecting-privacy-with-referrers/392382738919/

I don't think there's a way around this.. unless FB changes their redirect methods.

Nov
21
1 month ago
Activity icon

Replied to Can't Pass Local Variable To Another Method.

The solution is in the error. The method payment_process expects two parameters

  1. Request object
  2. $productPrice

You are only passing the $productPrice a float to it so it's expecting Request object and getting a float.

You have two options

#1. Remove the first parameter Request $request from your payment_process method (assuming you are not using it) and that will solve your problem. Your payment_process method should look like this now..

public function payment_process($productPrice) {
       
        \Stripe\Stripe::setApiKey('...');
        try {
            Charge::create ( array (
                    "amount" => $productPrice * 100,
// etc ....

#2. Pass the $request object like so in your payment method.

$this->payment_process($request, $productPrice);
``
Nov
13
2 months ago
Activity icon

Awarded Best Reply on How To Convert Axios Response To DataURI?

Check this issue thread on axios/axios out, it has multiple solutions https://github.com/axios/axios/issues/513 :)

Nov
11
2 months ago
Activity icon

Awarded Best Reply on Team Create On Registration But Not On Team Invite.

By default only 'owners' can invite people. So allow the registration of a company assuming it's the 'owner' registering every time.

You'll want to add the following to your booted method of your SparkServiceProvider:

Spark::noAdditionalTeams();

See https://spark.laravel.com/docs/9.0/teams at the bottom of Introduction

Nov
09
2 months ago
Activity icon

Replied to Database Schema For Posts With Hashtags And Mentioned Users

Depends how you want to use them and if you want to run reports on usage, etc.. but yes your on the right track..

table: posts

  • id
  • name
  • etc

table: hashtags

  • id
  • name

table: post_hashtags (pivot)

  • post_id
  • hashtag_id
Nov
08
2 months ago
Activity icon

Replied to Autocomplete = "off" Not Working

This seems to be a never ending fight with Google to respect the autofill/autocomplete. There are hackable solutions that may work, but I haven't had a ton of luck.

Check a look at this example thread with some possible solutions https://stackoverflow.com/questions/12374442/chrome-ignores-autocomplete-off

Nov
06
2 months ago
Activity icon

Replied to Spark: How To Allow Users To Not Belong To Any Teams?

It's in the VerifyUserHasTeam middleware. See https://github.com/laravel/spark-aurelius/blob/9.0/src/Http/Middleware/VerifyUserHasTeam.php

If Spark::usesTeams and the user doesn't have any teams, it'll redirect the user to /missing. You can try overriding or creating your own middleware that get's used in this instance.

It's being used in the install stubs that get copied to app/Http/Kernel.php .. see https://github.com/laravel/spark-aurelius/blob/2b4a4225c2045c27597c807f3e786803bed7b53a/install-stubs/app/Http/Kernel.php

Activity icon

Replied to How To Convert Axios Response To DataURI?

Check this issue thread on axios/axios out, it has multiple solutions https://github.com/axios/axios/issues/513 :)

Activity icon

Replied to Team Create On Registration But Not On Team Invite.

By default only 'owners' can invite people. So allow the registration of a company assuming it's the 'owner' registering every time.

You'll want to add the following to your booted method of your SparkServiceProvider:

Spark::noAdditionalTeams();

See https://spark.laravel.com/docs/9.0/teams at the bottom of Introduction

Activity icon

Replied to Advice On Updating Database Entries Via Jobs

This is what chained jobs are for. https://laravel.com/docs/5.8/queues#job-chaining check them out!

I think you are on the right path and they are doing exactly what they should be.

Oct
31
2 months ago
Activity icon

Awarded Best Reply on Save Stream File To Filesystem

Looks like you have permission issues on accessing files on AWS. Check your AWS file permissions for your bucket/upload user and that should resolve the issue.

Also try this when storing the file.. to make the permission public.

Storage::put(
    $request->recording_uuid.'.mp3',
    Nexmo::get($request->recording_url)->getBody(),
    'public' // See this 
);

Also if that doesn't work, check this thread for some ideas https://laracasts.com/discuss/channels/laravel/laravel-52-amazon-s3-viewing-uploaded-file-accessdenied

Oct
30
2 months ago
Activity icon

Replied to Spark - Multiple Developers Working On Spark Project

You need to generate a Git token from the account that has access to the Spark repo, then add that into the composer file so it's used to retrieve the private package. It'll be added to your projects composer.json looking like so..

{
    "config": {
        "github-oauth": {
            "github.com": "your-generated-token-here"
        }
    },
}
Activity icon

Replied to Save Stream File To Filesystem

Looks like you have permission issues on accessing files on AWS. Check your AWS file permissions for your bucket/upload user and that should resolve the issue.

Also try this when storing the file.. to make the permission public.

Storage::put(
    $request->recording_uuid.'.mp3',
    Nexmo::get($request->recording_url)->getBody(),
    'public' // See this 
);

Also if that doesn't work, check this thread for some ideas https://laracasts.com/discuss/channels/laravel/laravel-52-amazon-s3-viewing-uploaded-file-accessdenied

Oct
17
3 months ago
Activity icon

Replied to Help With Getting FileSystem Working?

Your using storage_path() helper in your root. This literally uses /storage + whatever you have inside the ().

What you would want is public_path instead of storage_path. However I don't recommend doing it that way. Instead follow the doc's suggested method.

Upload to the storage path, and then symlink your storage folder to public.

The public disk is intended for files that are going to be publicly accessible. By default, the public disk uses the local driver and stores these files in storage/app/public. To make them accessible from the web, you should create a symbolic link from public/storage to storage/app/public. This convention will keep your publicly accessible files in one directory that can be easily shared across deployments when using zero down-time deployment systems like Envoyer.

Check this out on how to symlink storage to public and how to use the asset() helper https://laravel.com/docs/5.8/filesystem#the-public-disk

Activity icon

Replied to LazyController Still Running Out Of Memory?

Try batching the insert statement.

Oct
15
3 months ago
Activity icon

Replied to Problem With Group By First Letter JavaScript

I'd suggest doing this in the collections level of Laravel using something like mapToGroups.

Here's an example

public function chunkByAlpha(Collection $collection)
{
    return $collection->mapToGroups(function($item, $key) {

        return ($this->isAlpha($item->name[0]) ? [strtoupper($item->name[0]) => $item] : ['#' => $item]);
    });
}

public function isAlpha($toCheck)
{
    return preg_match("/^[a-zA-Z]+$/", $toCheck);
}

Taken from https://stackoverflow.com/a/53766995/610880

Activity icon

Replied to What's The Best Timeline Package In VueJs

It really depends on what features or functionality your looking for. What's best for you isn't necessarily what's best for someone else.

That being said, here are some options!

Activity icon

Replied to Displaying Nested Comments ..... 10 Nested Replies At A Time

This really depends on how your database is structured and how things are linked together. Here's an article that explains a nested comment system from start to finish https://appdividend.com/2018/06/20/create-comment-nesting-in-laravel/

Activity icon

Replied to Get Relationship From Array Of Ids

I'm not entirely sure about casting to an array and subsequently a relation however you could loop over the arrays using a Accessor (which is a way to format attributes when you retrieve them from the db) and create your object/array of relations manually.

Activity icon

Replied to Duplicate Keys In Array

Can you remove the Applicant key itself and let it default to a number.. since they are all stored in an Applicants key-named array?

Activity icon

Replied to Multi-website With One System

That's not how you would ideally do it. Also it's frequently references as "multi-tenant" paired.

Here's a good article on it https://medium.com/@weihien90/laravel-5-simple-subdomain-for-multi-tenant-application-551ee489b599

The article gives some examples on how to implement middleware to "CheckTenant" and what to do from there :)

Oct
09
3 months ago
Activity icon

Commented on Integrate A Site Template

Why drag the CSS into the pub directory, instead use the resources/css + Laravel Mix? Feels misleading to new comers..

Oct
07
3 months ago
Activity icon

Replied to Teams Via Subdomain

Something along the lines of this https://medium.com/@weihien90/laravel-5-simple-subdomain-for-multi-tenant-application-551ee489b599

If you do pursue it with Spark, it'll work almost the same way.

Sep
30
3 months ago
Activity icon

Replied to Where Are You All From?

Canada eh :)

Sep
24
3 months ago
Activity icon

Replied to Check Quantity If It Available On Stock

We don't know what your database looks like for the products or how it's structured. But you can do a check in your controller/service to check stock beforehand (before any save logic) and respond accordingly..

Sep
01
4 months ago
Activity icon

Replied to How Would You Set Up "Credit" In Movie Database

I think the pivot table is the best optioin. If you want to have parent and sub credits, then apply that on your pivot table..

person_id | movie_id | role_parent_id | role_child_id
Aug
14
5 months ago
Activity icon

Replied to Are Event Listeners Cached In Some Way?

From the docs..

... during your deployment process, you should run the event:cache Artisan command to cache a manifest of all of your application's events and listeners

So yes event & listeners are cached. Clear your cache on deployment and if you are using queue's, restart them on deploy.

Aug
01
5 months ago
Activity icon

Replied to Saving API Usage For Metered Billing

I don't know of any handy package but I want to suggest using Middleware to do the counting for you, it abstracts that logic away from your API endpoint controller methods.

If you do build one, you should publish it as a package, I'm sure others would appreciate it :)

Activity icon

Replied to How To Setup A Callback API Endpoint That Recieves Payment Status From A Payment Gateway

I'm not sure what Payment Processor you are using but you would look at their dev docs to see what is being sent to your server when you provide them with a webhook. Are they providing a POST or GET request?

They should also provide you with some information as to what they are POSTing. Typically a webhook will be a POST especially when they are sending you a bunch of data.

So check your PP's dev docs to see what they send you and how. Outside of that it's up to you to do with the $request as you choose.

As an example, MailGun will POST to a webhook URL I provide. I used their docs to find out what they POST to me and I actually validate the incoming request (using custom Middleware) well I validate the signature included in the request.

So check the docs, and what you are provided with do what you need to with the $request :)

Jul
30
5 months ago
Activity icon

Replied to Change Request Body Middleware

Your looking at (from the title) a method for Slim maybe?

You can do this with Middleware doing so like this:

Example File: app/Http/Middleware/TestMiddleware.php

<?php namespace App\Http\Middleware;

use Closure;

class TestMiddleware
{

    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request $request
     * @param  \Closure $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        $input = $request->all();

        if (isset($input['foo'])) {
        $input['foo'] = 'bar';

            // Input modification
            $request->replace($input);

            \Log::info($request->all()); // Shows modified request
        }

        return $next($request);
    }

}
Jul
24
5 months ago
Activity icon

Replied to Convert String Array To Array Of Int(s)

array_map to intval ;-)

$array = ["123", "34", "223"];
$integerIDs = array_map('intval', $array);