Member Since 5 Years Ago

Irving, TX

Experience Points 93,495
Experience Level 19

1,505 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 709
Best Reply Awards 57
Best Reply
  • 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.


    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.


    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.

12 Aug
1 week ago

clay left a reply on Npm Run Production: ERR! Code ELIFECYCLE

what did this end up being? I'm getting the exact same problem.

29 Jun
1 month ago

clay left a reply on Laravel 5.6 & Algolia Search Return Empty Result

@pirmax what ended up being the problem? Having the same issue.

15 Mar
1 year ago

clay left a reply on Zend Bar

Checkout this issue on the homestead repo.

clay left a reply on Loading The Wrong Page

These two routes are the same:

Route::get('/posts/{create}', '[email protected]');

Route::get('/posts/{post}', '[email protected]');

Why is 'create' inside {}?



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

Route::get('/posts/create', '[email protected]');

Route::get('/posts/{post}', '[email protected]');

Route::post('/posts', '[email protected]');
27 Oct
1 year ago

clay left a reply on Pi (π) Button

super + shift + click

17 Oct
1 year ago

clay left a reply on Tinker : ErrorException : Directory Not Empty

i know this doesn't help, but I just started having the same problem.... Investigating...

19 Sep
1 year ago

clay left a reply on Can Somebody Tell Me How To Host Laravel Project.. I Talked With Many Hosting Compnay

Google "Laravel shared hosting". There are many blog posts that tell you step-by-step how to do it. Some are a couple of years old, but still should contain relevant information.

14 Sep
1 year ago

clay left a reply on Having Trouble To Set Up Auto-discovery For A Facade

I tried loading your package to test, but packagist is on 0.0.3 which doesn't include the "laravel" key in composer.json for auto-discovery.

13 Sep
1 year ago

clay left a reply on Roles And Permissions In Native Laravel

In the past, I've used a couple of different packages for this, but recently, I've found that it isn't very difficult to implement and you'll have much more control if you do it yourself. Jeffrey has a video that may help: Roles and Permissions Here is the github repo for that video.

The video is for Laravel 5.1, but it should still get you started.

clay left a reply on How To Make A Custom FormRequest Error Response In Laravel 5.5

From the upgrade documentation:

A Note On Form Requests

If you were customizing the response format of an individual form request, you should now override the failedValidation method of that form request, and throw an HttpResponseException instance containing your custom response:

use Illuminate\Http\Exceptions\HttpResponseException;

 * Handle a failed validation attempt.
 * @param  \Illuminate\Contracts\Validation\Validator  $validator
 * @return void
 * @throws \Illuminate\Validation\ValidationException
protected function failedValidation(Validator $validator)
    throw new HttpResponseException(response()->json(..., 422));

clay left a reply on Vue Interpolation

<h1>@{{ $text }}</h1> or

    <h1>{{ $text }}</h1>

clay left a reply on Forums

There's a 77 episode series here on laracasts on how to build a forum.

21 Jun
2 years ago

clay left a reply on Loading Package Assets (css/js) Into The View NOT Using Artisan Publish

Also, I was just reading up on the package auto-discovery coming to Laravel 5.5 and it looks like it only affects adding the service provider and facade. Looks like users will still have to publish any assets. My apologies for misleading you.

19 Jun
2 years ago

clay left a reply on Loading Package Assets (css/js) Into The View NOT Using Artisan Publish

It would probably help to have a look at some other laravel packages similar to yours to see how it is handled. It's really hard to say, not knowing your package. There are many options based on what you're trying to accomplish. Depending on the scope of the package maybe a separate frontend package would even be an option. Otherwise, for a backend php composer package, it doesn't seem like you would want to be providing a lot of javascript or css and probably shouldn't be updating it very often. Like I said though, it's hard to say. There are so many different situations that would be handled differently.

18 Jun
2 years ago

clay left a reply on Loading Package Assets (css/js) Into The View NOT Using Artisan Publish

For package specific views and assets, that is the purpose of publish. In framework agnostic applications, packages that provide views and assets, require the end-user to copy/paste assets to their app directory, or use some programmatic alternative solution. Laravel provides the 'publish' command as a convenience to the user.

Laravel Publish Package Assets

On the other hand, when dealing with config files, these are usually only copied when the user needs to customize. The author can set reasonable defaults. Assets and views are different. Since Laravel knows only one location for views and assets, we can't refer to a vendor location. (You could probably hard-code some stuff to make it work, but you don't want to go that route.)

Last, Laravel 5.5, due out by the end of July, has implemented 'auto-discovery' for packages. This allows the package author to add a few lines to their composer.json file and when the package is installed, assets, views, migrations, config, etc. can all be automatically published. For now though, your README just needs to be thorough in defining the installation steps, including publishing assets.

clay left a reply on Some Issues With Laracast And The Popular Course Here On Laravel

Anyone that can come here touting Udemy is suspicious from the start. Udemy facilitates for-profit, stolen education. They are an example of how not to run a tech ed. site.

There are ~1000 videos on the site with endless discussion of each. You signed up, watched one episode of 50 episode series and then wrote a critique of the entire Laracasts business.

If you want to know the tools, there are many series' here about that. "How to Build a Forum" is an advanced series in which it is assumed you know the fundamentals of developing with modern PHP.

13 Jun
2 years ago

clay started a new conversation Prevent Javascript Package From Pulling In Jquery

javascript 101 i'm sure, but I'm not having any luck. In my resources/assets/js/app.js:


in my webpack.mix.js:

mix.js('resources/assets/js/app.js', 'public/js');

now, when I 'npm run dev', the public/js/app.js is created as it should be, however, since 'the-package' depends on jquery, and jquery is available in my node_modules, it is automatically pulled in and added to public/js/app.js. I want to simply prevent jquery from being automatically pulled in. Of course, my setup is much more involved than this, but I stripped it down to this one problem. Any pointers?


09 Jun
2 years ago

clay left a reply on Calculate Age From Birthday

with Carbon, you can call 'age'

var_dump(Carbon::createFromDate(1977, 1, 15)->age);

or since Laravel can convert your dates to Carbon instances

18 May
2 years ago

clay left a reply on MySQL Requires TEXT Fields To Have A Default Value In Strict Mode??

I usually see this error when I forget to mark a field as 'nullable' in the db. If you're using laravel migrations, then:

09 May
2 years ago

clay left a reply on Always Returning App\User

If you're extending a User model in a package, you shouldn't change your model in config.auth. Your model is still App\User, it just has a parent. Also, the packages' User model, theoretically, should extend Authenticatable.

For example, Spark has a User model which extends Authenticatable. In my app, I have an App\User model which extends Laravel\Spark\User. My config.auth remains as-is (App\User).

clay left a reply on Error On Vagrant Ssh In Homestead, User Directory With Whitespaces

have you tried using quotes in your config

        map: 'C:\Users\John Doe\code'
        to: /home/vagrant/Code
28 Apr
2 years ago

clay left a reply on Removing Route

The 'home' that is showing in your route:list, isn't referring to the name of the view. Can you show your entire routes file.

clay left a reply on Laravel Mix Put All Js Code Inside App.js

checkout this page on the mix documentation

clay left a reply on Code After Middleware

using the middleware closure in your controller constructor, you can get the current user and use it in your action methods:


namespace App\Http\Controllers;

class HomeController extends Controller

    private $user;

    public function __construct()
        $this->middleware(function($request, $next) {
            $this->user = auth()->user();
            $response = $next($request);

            return $response;

    public function index()


See this post on Laravel News for more info about this caveat.

26 Apr
2 years ago

clay left a reply on Code After Middleware

Sounds like the job of a custom middleware. Maybe instead of calling $this->middleware('auth');, just create a new middleware that combines the auth logic with your custom logic and use that instead. Another option would be to leave the auth middleware then add a second middleware using a closure like:

$this->middleware(function ($request, $next) {
    // ...

    return $next($request);

*note You don't have access to the logged in user in your controller constructor unless you use the closure based middleware.

07 Apr
2 years ago

clay left a reply on How Can I Set My Laravel Files To Sending Mails To All Clients . (Universal)

mailtrap is just for catching all emails during development. to actually send email, either sign up with a client like sendgrid, mandrill, mailgun, or alternatively, use your gmail. Just search this forum for "send mail with gmail" and you'll find lots of answers.

06 Apr
2 years ago
02 Apr
2 years ago

clay left a reply on Event.$on Runs Its Callback Function When The Componenet Is Created, Despite The $emitter Has Not Emitted Any Event

I'm thinking maybe the alert should be wrapped in a function?

created () {
    Event.$on('login', function() {
        alert('am handling')
28 Mar
2 years ago
27 Mar
2 years ago

clay left a reply on [Socialite] How To Handle Providers That Don't Return The Email

For sites with social integration, I usually don't ask the user for any information. I use a one-click registration and login. However, I do ask them to confirm the registration information before adding the user to my db(In case someone else was logged into a social site and they didn't realize it). So, if the user doesn't exist and their email wasn't returned with the socialite object, I also show, along with the returned information, a single-input form for their email address. They can confirm the returned info and add their email address at that point. It may not be ideal, but it's still pretty simple.

24 Mar
2 years ago

clay left a reply on Route Model Binding Produces 404, Even Though Route Exists

Check out the docs on this.

Your placeholder must match the method parameter and it must be type-hinted for the model. So if I wanted to use route model binding for showing a single user:

Route::get('/myapp/user/{user}', '[email protected]');
public function show(User $user)

clay left a reply on Include VueJS With Webpack

If you want to be able to just call "Vue" from any javascript file, you'll need to add this line to your entry point, or at least in a file that is required very early in the process.

window.Vue = require('vue');

instead of

Vue = require('vue');

if you do the latter, then you'll need to do that in every file in which you want to reference Vue. Or you could setup autoloading for Vue. There are many different options for this.

Of course this all depends on Vue being available in your node_modules directory.

19 Mar
2 years ago

clay left a reply on How Can I Submit Code Improvement Of Laravel To Taylor?

I don't know if it was clear, but the laravel project that is installed that requires your framework branch as a dependency, is for testing your changes. Of course, you would need to add/push/commit, etc., from within your framework fork directory. Do not run these git commands from within your testing laravel project directory.

clay left a reply on How Can I Submit Code Improvement Of Laravel To Taylor?

Checkout this blog post by @mattstauffer. It explains the process of forking, cloning, making changes, pushing, etc.

If you're completely new to this, the following may be overwhelming, but maybe it will help someone that's trying to figure this stuff out.

  1. Visit the Laravel Framework repo on Github.
  2. Click the 'Fork' button. This will create a repo under your account, of the Laravel Framework.
  3. Go to your forked repo's page on your Github and click the "Clone or Download" button.
  4. Copy the .git link that appears, to your clipboard.
  5. Open your terminal and go to the parent directory where you keep your projects (or a location of your choosing).
  6. In your terminal, run the command git clone THE_LINK_THAT_YOU_COPIED
  7. cd into the newly created folder ("framework")
  8. Back in your browser, go to the main Laravel Framework repo on github and click the "Clone or Download" button.
  9. Copy the .git link that appears, to your clipboard.
  10. Back in your terminal, run the command git remote add THE_LINK_THAT_YOU_COPIED
  11. Determine which branch you want to target. For new-major features, this would be "master", for bug fixes/minor-non-bc-break-features, this would be the latest stable version "5.4".
  12. In your terminal, run the command git checkout THE_BRANCH_YOU_ARE_TARGETING.
  13. Run git fetch upstream
  14. Run git merge upstream/THE_BRANCH_YOU_ARE_TARGETING
  15. Run git push origin THE_BRANCH_YOU_ARE_TARGETING
  16. Decide on a name for the branch you will be using to develop the feature/bug fix.
  17. Run git checkout -b YOUR_NEW_BRANCH_NAME
  18. Now you are ready to make your changes to the code, but before we go on, you need to setup a laravel project in which you use your branch as a dependency.

Prepare a laravel project to use your branch of the framework

  1. In your terminal, go to the parent directory where you keep your projects(or a location of your choosing) and run the command laravel new my-new-feature. Then cd into that folder.
  2. If targeting the next release("master"), there maybe inconsistencies between the latest laravel application and laravel framework, so you may want to use the dev version of the application when you spin up your project (Never done this myself, I always use the current application).
  3. In the composer.json folder of your application, you'll need to make changes to target your branch.
  4. At the bottom of the composer.json, add the following block(be sure all blocks are separated by a comma:
 "repositories": [
            "type": "vcs",
            "url": ""
  1. In the 'require' block of composer.json, change the following line
"laravel/framework": "5.4.*",

for the version, use "dev-YOUR_NEW_BRANCH_NAME" e.g.:

"laravel/framework": "dev-add-my-new-nifty-feature",
  1. Save the file and from inside the project root, run composer update
  2. Now your project should be using your forked branch
  • Of course, you could just install a new laravel app and make your changes within the vendor directory, then replicate those changes on your framework fork, but having to copy code from one repo to another increases the risk of mistakes.

  • Also, if you leave any packages in composer.json that depend on the framework, you'll get conflicts when trying to require your dev branch. You'll need to remove those dependencies from composer.json. ie. Dusk and Tinker.

Resume steps from above

  1. Make the changes necessary to introduce the feature or fix the bug.
  2. From within your framework fork root directory, while on the branch that you created, run git add . and git commit -m "your commit message"
  3. run the command git push origin YOUR_NEW_BRANCH_NAME
  4. Go to your repo page and there should be a green button that says "Compare and Pull request". Click this button and follow the instructions to Add a title and description.
  5. Once you submit the pull request, a couple of tests will automatically run to make sure there are no conflicts and make sure there are no style issues.
  6. If changes are required, use your editor to make these changes, then add/commit/push.
  7. If you end up with a lot of additional small commits that fix style problems, etc., it may be best to squash your commits into one.

Squash your commits down to one

  1. Decide how many commits need to be squashed
  2. Run the command git rebase -i HEAD~4 (where 4 is the number of commits that have been made)
  3. An editor will appear that looks similar to the following:
pick 01d1124 adding my new feature
pick 6340aaa style fixes
pick ebfd367 style fixes
pick 30e0ccb a small refactor

# Rebase 60709da..30e0ccb onto 60709da
# Commands:
#  p, pick = use commit
#  e, edit = use commit, but stop for amending
#  s, squash = use commit, but meld into previous commit
# If you remove a line here THAT COMMIT WILL BE LOST.
# However, if you remove everything, the rebase will be aborted.
  1. Leave the word "pick" on the first commit, but on the subsequent lines, change "pick" to "squash", then save and exit the editor.
  2. Another file will appear in the editor, giving you the opportunity to change the commit messages. I usually leave this as-is and save and exit the editor.
  3. run the command git push origin YOUR_NEW_BRANCH_NAME -f (be sure to add the "-f")

I know this is a lot of info and I'm sure people have many different ways to do this, but this is my workflow. There should be enough info there to get you started. Depending on your OS, things may work a little differently but everything should still apply.

Be sure everything works as expected before actually submitting the PR. If something goes wrong with git along the way and you can't work your way out of it, it's no big deal. You can safely delete your local and remote repos and start the process over.

Finally, be prepared for blunt/honest feedback, that is sometimes brief, on your pull request. There are only a few people watching these PRs and only Taylor actually merges.

Also, note the following from the contribution guide:

You may propose new features or improvements of existing Laravel behavior in the Laravel Internals issue board. If you propose a new feature, please be willing to implement at least some of the code that would be needed to complete the feature.

Informal discussion regarding bugs, new features, and implementation of existing features takes place in the #internals channel of the LaraChat Slack team. Taylor Otwell, the maintainer of Laravel, is typically present in the channel on weekdays from 8am-5pm (UTC-06:00 or America/Chicago), and sporadically present in the channel at other times.

18 Mar
2 years ago

clay left a reply on Use Dropzone With Laravel

If you have a paid account here at laracasts, jeffrey actually covers dropzone in one of the videos from Build Project Flyer with Me. Not sure exactly which video, but probably one of the ones related to forms.

clay left a reply on How To Edit Node Modules?

If you're using charliekassel/vuejs-datepicker, check the issues on the repo. Looks like several people have asked similar questions. charliekassel/vuejs-datepicker If that's not the one you're using, be sure to check the issues section of the repo. Likely, there's a prop you can pass for the css class.

Edit: Not a good idea to edit anything in node_modules.

clay left a reply on ConvertEmptyStringsToNull Not Working With Vue

With the new middleware added in 5.4, there were some issues that came up with validation rules that had worked in previous versions. I just know that I've seen this come up in the framework repo issues several times and this is the answer that is given each time.

17 Mar
2 years ago

clay left a reply on Axios Get Data

Did you make a typo in your function when you typed it in your question? If not, it has an error.

    axios.get('/api/orig').then( (response) => {
        this.origs =

Note the big arrow inside the 'then'.

Also, if you're trying to alert below the axios.get call(outside the closing curly), then you're alerting before the ajax call finishes and therefore orig hasn't been set yet.

clay left a reply on ConvertEmptyStringsToNull Not Working With Vue

Add nullable to your validation rules:

$rules = [
    'website' => 'url|nullable'
12 Mar
2 years ago

clay left a reply on User To User Relationship

Here's a generic summary of what is needed for your situation. The example is a little old, but should still apply. Laravel - User Friendships

A Friend_user model isn't necessary. The relationships are defined on the User model. It IS possible in Laravel 5.4 to define a custom pivot model, but it is unnecessary in this case.

clay left a reply on User To User Relationship

if you want timestamps on your pivot table, just make sure your migration has $table->timestamps() and in your relationship methods, add 'withTimestamps'. e.g.


clay left a reply on Laravel 5 Suggest The Pagination Don't Hard Coding The Ul Tag By Default

Check out the laravel docs. Is this what you mean? You can publish the views then customize however you wish.

clay left a reply on Why Login Page Still Showing On Footer After I Logged In On

Just a simple oversight, doesn't really cause any problems. @JeffreyWay

clay left a reply on New Blade Files Showing 404 Error

When you say "I navigate to the file", how are you doing this? Can you show your routes file and/or the associated Controller & method?

If you have 'trades.blade.php' in the root 'views' folder, then at the least, you'll need a route in your 'routes\web.php' file. e.g.


Route::get('/trades', function(){
    return view('trades');

or using a controller:



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

namespace App\Http\Controllers;

class TradesController extends Controller

    public function index()
        return view('trades');

clay left a reply on Must Be An Instance Of Facades\Validator, Instance Of Validation\Validator Given

You shouldn't be passing a facade to a constructor and assigning it to a property. Facades are designed to be used directly. just


namespace App\Http\Controllers;

use Validator;

class MyController
    public function store
        $validator = Validator::make($request->all(), [
            'title' => 'required|unique:posts|max:255',
            'body' => 'required',

        if ($validator->fails()) {
            return redirect('post/create')

or, in your controllers, if you're extending the base controller, you can just use the $validate method that is provided via the ValidatesRequests trait. e.g.

public function store(Request $request)
    $this->validate($request, [
        'title' => 'required|unique:posts|max:255',
        'body' => 'required',

    // Validation passed, store in database...
08 Mar
2 years ago

clay left a reply on Retrun Value In 'getFacadeAccessor' Method

you were using an alias in your binding but you were referencing, through the interface, the actual class. Laravel didn't know that when you asked for a VimeoVideoService, that you wanted the 'vimeo_video_service'. So to be clear:

public function register() {
    $this->app->bind('App\Services\Video\Contracts\VideoServiceInterface', ''App\Services\Video\VimeoVideoService');
    $this->app->singleton('App\Services\Video\VimeoVideoService', function($app) {
        $vimeo = new Vimeo(

        return new VimeoVideoService($vimeo);

    $this->app->alias('App\Services\Video\VimeoVideoService', 'vimeo_video_service');

Then, if you wanted to, you could even use resolve('vimeo_video_service'); and get the instance you need.

clay left a reply on Retrun Value In 'getFacadeAccessor' Method

just replace the string that you are using to identify the class in the binding with the string representation of the class itself,


instead of


Then, if you still need to refer to the service via the vimeo_video_service string, you can bind an alias to App\Services\Video\VimeoVideoService for example:

$this->app->alias('App\Services\Video\VimeoVideoService', 'vimeo_video_service');

clay left a reply on Retrun Value In 'getFacadeAccessor' Method

if you're trying to instantiate an interface, then you need to bind an implementation to it. e.g.

public function register() {
    $this->app->bind('App\Services\Video\Contracts\VideoServiceInterface', ''App\Services\Video\VimeoVideoService');
    $this->app->singleton('vimeo_video_service', function($app) {
        $vimeo = new Vimeo(

        return new VimeoVideoService($vimeo);

Not sure about the other error...

07 Mar
2 years ago

clay left a reply on Deleted Views File

is this a specific editor that you're right-clicking, or an OS feature, or a git desktop application, or .....

edit: after some googling, it looks like the OP is using a full-featured IDE like Eclipse, or PHPStorm, etc., that provides this functionality.

03 Mar
2 years ago

clay left a reply on Webpack And Bootstrap

or you can copy the bootstrap fonts from the node_modules folder over to where it is looking for them: