Founder at Geekybeaver

Ontario, Canada

Hire Me

Member Since 5 Years Ago

Experience Points 19,865
Lessons Completed 119
Best Reply Awards 19
Best Answer
  • 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


    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement


    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.

16 Jan
1 day ago

Braunson left a reply on Validation With Vuelidate

What's the exact problem/error? We need some more details. Is the issue on the Vue side or Laravel side?

Braunson left a reply on Workbox And Push Notification Integration

I can't speak for Workbox as I've never used it but I just setup Push Notification on a project a few weeks ago and I made use of the Web Push Notifications Channel and this demo of implementing it

07 Dec
1 month ago

Braunson left a reply on Am Stuck! Npm Install Returns A Whole Lot Of Errors

Looks like cross-env wasn't found. There may be more additional data in your log /home/vagrant/.npm/_logs/2018-12-07T23_34_26_478Z-debug.log

Run these commands..

rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install cross-env
npm install

That should solve the problem. If not there's a Laravel Mix thread here that may help

Braunson left a reply on Upgrading Via Composer

You may have this resolved already but the Spark::teamString method was removed in 6.x. More information at the upgrade guide (if you have access to the repo

If you haven't automatically updated your Spark views, you will have to do them manually. The new method is Spark::teamsPrefix()

Braunson left a reply on Does Anybody Know Basic SPARQL?

Not sure if you got this figured out but you weren't far off. This is a proper query:

SELECT ?coordinate_location WHERE {
  ?place wdt:P625* wd:Q27522895.
  OPTIONAL { ?place wdt:P625 ?coordinate_location. }

Braunson left a reply on Alert User Of Session Timeout

API routes (routes/api.php) are stateless which is why it doesn't work. You can create a new middleware group called something like apI_local and enable the session middleware on it,

Braunson left a reply on Forge Disk Size Defaults To 20 GB .... How To Create Bigger?

I noticed this the other day, I don't see a way to set this in Forge but in order to change the size, you'll need to do it all from AWS :(

Braunson left a reply on If You Have A Lot Of Php Method Files That You Have Built Up Over The Years...

You can also register the helpers folder in the composer classmap ;-)

Braunson left a reply on Login Redirect()->intended() Not Working

Are you using the default auth controllers or a manual one. If manual check this

Also confirm that your SESSION_DRIVER is properly recording sessions :)

Braunson left a reply on Change A Db Raw To A Collection

If the query is correct and runs properly, ->get() should return a Collection of items. I would suggest dumping your raw query using the code below, and manually running it in the DB to see if it's correct first.

20 Nov
1 month ago

Braunson left a reply on Email Using Mailgun

If you are using Mailgun as the mail driver in Laravel, then if you are using Mailables you can specifically set the plain text of an email.

See "Plain Text Emails" in the docs here

However if you are using the MailGun plugin/package directly, then you should refer to that packages docs/repository.

16 Nov
2 months ago

Braunson left a reply on Forcing Downloads Is Not Working In All Browsers.

Have you tried using the Lumen download method?


The download method may be used to generate a response that forces the user's browser to download the file at the given path. The download method accepts a file name as the second argument to the method, which will determine the file name that is seen by the user downloading the file. Finally, you may pass an array of HTTP headers as the third argument to the method:

I've had issues with certain browsers downloading files depending on the headers set.

Braunson left a reply on How To Make Custom Eloquent Relationship Classes

Yes you can create custom relationships.

Here's an example for BelongsToEmpty, a very simple example in this case to return a valid empty BelongsTo relation.


namespace App\Relations;

use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class BelongsToEmpty extends BelongsTo
    public function getResults()
        return Collection::make();

    public function get($columns = ['*'])
        return Collection::make();

I just placed this in app/Relations/BelongsToEmpty.php composer will autoload it. I can then use it in my models as needed.

For another more complex example, check out this BelongsToMorph relation class here

Braunson left a reply on Database Design Suggestion

  • admins

  • users

  • surveys

    • admin_id
    • name
  • survey_questions

    • survey_id
    • question
    • survey_answer_id
  • survey_answers

    • survey_id
    • survey_question_id
    • answer
  • survey_user_answers

    • survey_id
    • survey_question_id
    • user_id
    • answer

A survey can/has many questions. You can make use of the JSON/array type to store the possible answer options.

That's just one way to do it..

18 Jul
5 months ago

Braunson left a reply on URL - Remove Square Bracket From Url While Using GET Method

@sanjay that is how browsers pass an array by default to the URL. If you want a custom format, you need to implement some JS that turns the array into a string and push that as the URL.

Here's a good thread with some examples on how to take care of this both in the frontend and backend.

17 Jul
6 months ago

Braunson left a reply on Use Tinker With Code From File

Tinker isn't for running full files of code. Instead it's meant to be able to run a few lines at a time to interact with the application without having to spin up a local server.

If your code is a class you want to interact with, include it in your app (e.g. Autoload it in) and in Tinker you can call the class and do what you need there.

tldr:: Tinker is a tool to help interact with the app without needing to spin up a server. It's a simple feature you can use to test a couple of lines you'd normally delete from your project.

Braunson left a reply on Brainstorm Help - Using Pluck In A Form::select For Default Value When It Is Null

The error means the categories collection/result is empty. There are no categories for the card.

You could instead try using the optional helper in that case. However think if there's no values you need a default. So try this out.

{{ Form::select('primary_category_id', $categories, optional($card->categories()->where('primary', 1)->first())->id ?? 1, ['class' => 'form-control', 'placeholder' => 'Please select a Primary Category']) }}

This will check for the first category with that condition and return the ID otherwise if there's no category we use the null coalescing operator (??) (PHP 7.0+) to return a (default) 1 ID, you can change this to the default you want.

Braunson left a reply on Dynamic Plan Creation

Perhaps this is closer to what you are looking for:

LaravelSparkDynamicPlanProvider - Laravel Spark Service Provider that allows to create Plans with Eloquent and have them created on Stripe, automatically loading them into Spark.

If you were looking to limit functionality by plan, you could use middleware/policies.

The reason for plans being setup to be static is because they reference a Stripe plan in Stripe for a set price so if you want different plans, you'll need different plans in both Stripe and Spark.

If you want to filter the plans offered to the user based on user selection just update your view that shows plans and only show the plans with X,Y,Z based on your filtering criteria. If you need to create dynamic plans, use the package linked above.

16 Jul
6 months ago

Braunson left a reply on Problem With Setting Route In Aplication

Can you post your routes.php line where it set's the route for the route your having an issue with first?

Braunson left a reply on Store An Array Of JSON Data In Mysql Database

Is your table your storing the json data set to json? You should be able to pass it a normal PHP array and it should encode and store it/return it for you accordingly. Make sure to set it as an array in your Model's casts array.

Learn more about it

Migrations support json and jsonb columns (

Docs + Articles:

Braunson left a reply on Registration Signup Queue

Add the bool as a flag to the users table which you could call let_in which is true once they are let in. In the view you would use it to show or to hide them in the collection.

Keep a user's points for actions taken in a separate table e.g. user_points with columns like user_id, action_taken, points_added, complete_date, etc..Use a hasMany relation User -> hasMany -> user_points.

Braunson left a reply on How To Redirect Without Http?

Something like this?


Or if you want to redirect to a custom URI:

11 Jul
6 months ago

Braunson left a reply on Connection For Controluser As Defined In Your Configuration Failed In PHPMyadmin.

Sounds like your config details in phpMyadmin/ may be incorrect.

This can occurs if you have another MySQL instance installed and the username and the password that you use in this config are different. You have to change the username and the password in the above file to match.

/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root'; // << Change this to your values
$cfg['Servers'][$i]['password'] = 'root';  // << Change this to your values
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';

Braunson left a reply on Print Dynamic Message In Session Variable

You'll want to echo out the session message in your view.

More info at

    {{ Session::get('message') }}
10 Jul
6 months ago
09 Jul
6 months ago

Braunson left a reply on Loading A Relationship Collection

Try using whenLoaded instead of relationLoaded

Braunson left a reply on Spark Routes On Subdomain

You'll want to look into updating existing or adding new middleware ;-)

Braunson left a reply on If Users Owns A Team Show All Team Members Data

What you want to do is check in the controller if this user owns the team, then if so get all team member's IDs and use whereIn. This is assuming you only store user_id on the Timesheets table (not team_id).

public function index()
    $user = auth()->user();
    $team = $user->currentTeam;
    $userids = [$user->id];

    // Check if the user owns the team or not?
    if ($user->ownsTeam($team)) {
        $userids = $team->users->pluck('ids');
    $currentweektotal = \App\Timesheets::whereIn('user_id', $userids)
                                        ->whereBetween('date', [Carbon::now()->startOfWeek(),Carbon::now()->endOfWeek()])

    $previousweektotal = \App\Timesheets::whereIn('user_id', , $userids)
                                        ->whereBetween('date', [Carbon::now()->subDays(7)->startOfWeek(),Carbon::now()->subDays(7)->endOfWeek()])

    $previousweekcount = \App\Timesheets::whereIn('user_id', , $userids)
                                        ->whereBetween('date', [Carbon::now()->subDays(7)->startOfWeek(),Carbon::now()->subDays(7)->endOfWeek()])

     return view('Timesheets.index', compact('currentweektotal', 'previousweektotal', 'previousweekcount'));

Braunson left a reply on Password Forget Recover Using Phone

This has been addressed already

Unless you hook a mobile phone to your server, you're going to need an external party (sms gateway) for this:

There are a few to choose from, and most are easy to install.

Braunson left a reply on Composer Update Not Working In Laravel 5.6

What error do you get when you try to run composer update? More details are needed.

Braunson left a reply on Axios Not Working Though The Data Is Saved In Database.

If you watch your network calls when you save, (Chrome dev tools > Network) what is the server response? Is the call even made to the server?

Braunson left a reply on Raw Query Relationship Trouble On View

The error says assignedUsersisn't a valid property.. Try dumping the $ticket param out to see what is there. Is it an object, array or collection?

06 Oct
1 year ago

Braunson left a reply on Storing Uploaded Images

I'm thinking the best method at this point is to use the storage directory and referencing the docs at symlink storage/app/public to public/storage.

Thoughts on any better way to do this?

05 Oct
1 year ago

Braunson started a new conversation Storing Uploaded Images

Running Laravel 5.5 on Forge. This is current flow of an image upload

  1. Uploaded to server in a temporary directory (resources/uploads/tmp)
  2. Queue process images into multiple sizes (original, large, medium, small, thumb)
  3. Queue process then moves saves those new sizes and moves the original to (public/images/large, etc.)

In the future S3 or something similar for storage is probably recommended but for now it's a side project :)

Can anyone suggest a better method to managing and serving images in this case? I'm moving 12k images over pre-launch to be resized and re-saved but wanted to see if there's a better method to do this.

03 Aug
1 year ago

Braunson left a reply on Laravel Mix And Glob

Bump, any update on this?

27 Apr
1 year ago

Braunson left a reply on On MAC : Memcached Class Not Found

Run phpinfo() and see where the config there is located to make sure it's the same you are getting in the CLI.

NOTE: There are two extensions for memcached in PHP, this may be where your having the issue.

  1. memcache
  2. memcached

It looks like you may be trying to use memcache but have the memcached extension installed.

Braunson left a reply on Route Not Find When I Use Other Function In Controller To Return View

First you should have a route, which then calls a controller method, which then displays a view. Something like this..


Route::get('display', '[email protected]');


class MyController extends Controller { public function display() { return view('myview'); } }

You can then pass in a query into the controller method `display` like so..

$products = Product::all(); // For example return view('myview')->withProducts($products);

Then in the view you can take `$products` and loop through it and display it as you please.

Hope this guides you a bit :)

Braunson left a reply on Changing Color Of Menu Bar

If your trying to change the color of the InfyOm generator, take a look at their docs specifically on changing the template.

Take a look at this, it tells you to publish your template so you can customize the templates.

21 Apr
1 year ago

Braunson left a reply on Laravel Mix - Jquery-ui / Sweetalert2 / Jquery-validation / Lity Install

@DShannon @livijn

To use the JS of the package you've installed, you'll need to add this line to include a package in say your app.js file


Regarding CSS styles, depending on how you use them, you can require them in JS/TypeScript OR include them like so in your app.css/scss

// For example, bootstrap that comes default with Laravel 5.4
@import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap";
27 Mar
1 year ago

Braunson started a new conversation Navigation - Two Items 'active'

When going to this thread.. presumably others the Apparel and Discussions nav items are highlighted / have the class is-active.

17 Nov
2 years ago

Braunson left a reply on Laravel 5.3 Maintenance Mode "message" Option Not Work

@dengdeng It looks like php artisan down simply displays this view

As per the docs The message value may be used to display or log a custom message which sounds confusing, doesn't it?

By default the 503.blade.php view doesn't use this message.

To read this message you should read a JSON formatted file named storage/framework/down that is generated by php artisan down command.

You need to do something like this to access the message in your view:

{{ json_decode(file_get_contents(storage_path('framework/down')), true)['message'] }}

Braunson left a reply on Stripe Webhooks Cannot Be Tested In Cashier

@bheath That's for 5+, I'm on a project that's still 4.2 (converting soon..)

Just got thinking, you could extend the WebhookController, override the handleWebhook() function to check for the environment which would dictate if it should run existsOnStripe or not.

Good to note for 5.x tho, thanks!

Braunson left a reply on Laravel Cashier Stripe Webhook Help

Yes this is 1+ years old, but having this issue with PHP 5.6.14. I made sure to run php artisan clear-compilerd; php artisan dump-autoload.

It seems the method_exists() function doesn't recognize my extended method. However if I run before it class_methods('WebhookController') it's listed first. Now if I run class_methods($this) in the same place, it doesn't show my extended method.

Anyone have any suggestions on how to resolve/fix this? I'm curious if this is PHP version related?