Member Since 3 Years Ago

Web/Software Developer, PHP at Sycamore Education

Experience Points 16,755
Experience Level 4

3,245 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 150
Best Reply Awards 0
Best Reply
  • 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.

06 Jul
1 year ago

xdega left a reply on UpdateOrCreate - Match Created_at (just The Date Part)

Sorry to necro, but I have the same issue and @SaeedPrez solution (PHP 7+) gives me a parse error.

Is there a cleaner way to accomplish this?

09 Feb
2 years ago

xdega left a reply on CSRF Protection Not Triggering?

...by explicitly invoking the web middleware in my route group, in the web.php file, I get a token mismatch on Postman client, but my web app is still making the axios call without issue, without any headers being included. This still makes me skeptical on the security of my application :(

xdega left a reply on CSRF Protection Not Triggering?

It seems that if you wrap the routes in a route group, they do not inherit the "web" middleware from the web.php file.

xdega left a reply on CSRF Protection Not Triggering?

Actually... I guess the API prefix DID indeed interfere with the behavior. Even when the route is defined in web.php.

xdega left a reply on CSRF Protection Not Triggering?

@Snapey Yeah. I even tried moving the routes to web.php, but they STILL went through. Although I did define them within an '/api' route group, which shouldn't have had an effect right?

xdega left a reply on CSRF Protection Not Triggering?

Yeah @ejdelmonico, I explicitly commented out the X-CSRF-TOKEN in my bootstrap.js, and it still carries out the requests. Even via the Postman client, no headers included.

xdega started a new conversation CSRF Protection Not Triggering?

So. I have the following endpoints in my routes in my api.php:

//POST routes
Route::post('/user/ban/{id}', function($id){

    $user = App\User::find($id);
    $user->is_banned = 1;
    $user->is_approved = 0;


Route::post('/user/unban/{id}', function($id){

    $user = App\User::find($id);
    $user->is_banned = 0;
    $user->is_approved = 1;


Route::post('/user/create-moderator/{id}', function($id){

    $user = App\User::find($id);
    $user->is_moderator = 1;


These are meant to be API calls via my VUE components, not accessible outside of the application.

My concern, however, is that these routes are working without requiring me to submit X-CSRF headers. Is there some kind of new feature in Laravel 5.4, or is there a way I can explicitly ensure that the CSRF protection is being utilized?

08 Feb
2 years ago

xdega started a new conversation Seeking Mentorship, Advice?

Dear Laracasts Community.

Today, I want to seek the professional guidance and mentorship of a community who shares a passion of mine. PHP Web development. In particular, Laravel.

Just a brief background. I graduated from college back in May 2016, with a Bachelor of Science degree in Communication and a minor in Computer Science. I was a peer tutor for both Communication and Computer Science for three years. I also conducted scholarly research on Computer-Mediated Communication, focusing on the implications of Social Media prevalence.

Aside from my educational background, however, I have always maintained a strong, dedicated, self-taught, skill-set in Web Development. I have been fascinated with how the industry has evolved, with Laravel being a fun-to-use platform on the cutting-edge of said technologies.

I have worked hard over the past couple of months, building some personal applications, putting together a portfolio of sorts. I have received a lot of advice, from a handful of concerned friends, helping to perfect my resume. Here is my current online portfolio — which I just redesigned yesterday — complete with a PDF resume download link: http://www.liamhockley.me

Here I am, however, unemployed, penniless, panicking, impending debts, a plethora of career applications submitted, and very little hope for the future. I know it will just take that one person to take a chance on me, but I want to know if there is anything I can do to expedite the process?

Can any seasoned professionals in the industry lend some advice for someone such as myself, seeking that “foot in the door” so to speak? How did you get your start in the industry? Etc.

PS: I have tried to do some freelance contract work via the Upwork platform (formerly Elance). But I often find it very underpaid, the clients have unreasonable demands, etc. This could be more so a consequence of my inexperience in managing clients.

31 Jan
2 years ago

xdega started a new conversation Feature Request: Streaming To Roku?

So. I love Laracasts. But one thing I find limiting is the inability to stream live to my TV via Roku. Much like what YouTube allows.

I know this is a mammoth task, and probably far outside the scope of the Laracasts project, but wanted to at least make the suggestion.

Great work with the site. I have been -- and will continue to be -- a huge fan.

ps: Eagerly awaiting the next addition to the Vue 2 series hint

26 Jan
2 years ago

xdega started a new conversation Validating Image URL?

So I have the following validation logic in my controller:

        $rules = array(
            'avatar'        => array('url', 'regex:~^https?://(?:[a-z0-9\-]+\.)+[a-z]{2,6}(?:/[^/#?]+)+\.(?:jpe?g|gif|png)$~'),

This works on a rudimentary level. It lets me check that an image URL is being provided. The problem is that it doesn't check if said image is a broken link.

Does anyone have any idea on how I could approach this problem? I am kinda stuck.

xdega left a reply on Errors When Trying To Update Via HTTP Route.

OK. I got it!

I ended up having to write the entire validation logic manually, in order to bypass the default behavior which is apparently not friendly with axios. Here is the solution to help anyone else who may have the same issue.

    public function update(Request $request, $id){

            $validator = Validator::make($request->all(), [
                    'avatar' => 'min:4',

            if ($validator->fails()) {

                return response()->json( $validator->errors() )
                ->setStatusCode(422, 'Unprocessable Entity');


            $edit = Profile::find($id)->update($request->all());

            return response()->json($edit);


PS. I even had to manually set the status code!

xdega left a reply on Errors When Trying To Update Via HTTP Route.

Scouring through the documentation, it seems to be that the controller is not picking up that the request is coming from the client-side. As such it is trying to redirect when validation fails.

xdega left a reply on Errors When Trying To Update Via HTTP Route.

Did some further digging, and I am seeing this in developer tools at the request with failed validation: PUT 302 text/html PUT 405 xhr

So it appears a second request is firing after the original 302 response. This ought to just be a JSON response with the errors no? What is going on?

Again, this works as indented when the validation passes.

xdega left a reply on Errors When Trying To Update Via HTTP Route.

Okay. Update. It turns out that, when the validator fails, the request URL is being changed to the originating URL (instead of the original request URL). Here is what I currently have in my controller logic:

        $this->validate($request, [
            'avatar' => 'min:4'

        $edit = Profile::find($id)->update($request->all());

        return response()->json($edit);

I suspect that the issue lies in needing to do something to catch/handle the validation failure? Any ideas?

25 Jan
2 years ago

xdega left a reply on Errors When Trying To Update Via HTTP Route.

I tried sending the method field through, ie. the following payload:

var payload = {'about':this.newAbout, '_method': 'PUT' }

xdega left a reply on Errors When Trying To Update Via HTTP Route.

this is my route:

Route::resource('/profiles', 'ApiProfilesController');

I am using a Resource Controller.

xdega left a reply on Errors When Trying To Update Via HTTP Route.

Ok. That gives me a response when validation passes, but I still get the Method not allowed error when validation fails.

xdega started a new conversation Errors When Trying To Update Via HTTP Route.

So. First off. I have the following method in a Resource Controller:

    public function update(Request $request, $id){

        //Validation Logic
        $this->validate($request, [
            'avatar' => 'min:3|alpha'


        return Profile::json($request->all()); //response()->json()


And I am making the following call via a vue component + axios:

            updateAvatar: function() {

                var payload = {'avatar':this.newAvatar}
                axios.put('api/profiles/' + this.profileID, payload)
                    .then( this.onSuccess() )
                    .catch( error => this.errors );

When I submit the request, I get one of two responses.

The first one (seemingly when the validation passes, and db actually updates) is:

BadMethodCallException in Builder.php line 2508:
Call to undefined method Illuminate\Database\Query\Builder::json()

the second error (seemingly when the validation fails) is: MethodNotAllowedHttpException in RouteCollection.php line 233:

This is working inasmuch as it updates the DB if validation passes, but totally broken behind the scenes.

I, obviously need to be able to access a response that gives me errors from the update itself.

Can anyone help shed a light on what might be going on here?

07 Jan
2 years ago

xdega left a reply on Charts.JS Not Rendering Properly On Mobile Device?

Yeah. JS resize options are also viable. The following CSS seemed to do the trick for now, though:

    @keyframes chartfix {
        0% {
            transform: scale(1.0);
            -webkit-transform: scale(1.0);
        50% {
            transform: scale(1.01);
            -webkit-transform: scale(1.01);
        100% {
            transform: scale(1.0);
            -webkit-transform: scale(1.0);

    .panel {
        animation-delay: 3s;
        -webkit-animation-delay: 3s;
        animation: chartfix 5s;
        -webkit-animation: chartfix 5s;

I encapsulated it into the Vue component itself, and it is barely noticeable on the visual side of things.

It is very unfortunate that Safari is so troublesome. Especially when you consider that any web browser running on IOS is, essentially, running Safari "under the hood".

I know many have given up and went with different chart frameworks, but I can't fault Charts.JS for something that is the fault of Apple. Besides, if the framework is good enough for Jeffrey, it is good enough for me.

xdega left a reply on Charts.JS Not Rendering Properly On Mobile Device?

I was able to replicate the issue by using Safari on OSX.

This appears to be a known bug, with some rather "hacky" workarounds: https://github.com/jtblin/angular-chart.js/issues/29

I am currently implementing a CSS animation workaround to trigger a "re-render", but this is certainly not ideal.

xdega started a new conversation Charts.JS Not Rendering Properly On Mobile Device?

As the title says, I am trying to figure out why my charts are not rendering on my IOS devices. I am using the Chart.JS library from www.chartjs.org.

Everything looks correct on Chrome on my Macbook, even when emulating device via the developer tools.

When I go to the live URL on my IOS device, however, I am greeted with the following:

Image of Broken Charts

Has anyone had any experience with this? Know of any workarounds?

Thank You.

PS: This shouldn't be a significant issue, but the chart is part of a Vue component.

06 Jan
2 years ago

xdega left a reply on Select Number Of Rows In Date Range Via Query Builder?

Well. With a little bit of diligence, I figured out a solution with the help of Carbon.

To help anyone else who may have a similar issue here is my much cleaner result:

    public function getPastMonth(){

        $now = Carbon::now();

        $result = $this->whereYear('created_at',$now->year)->whereMonth('created_at',$now->month)->count();

        return $result;


Note: This is just a function in the Model file.

xdega started a new conversation Select Number Of Rows In Date Range Via Query Builder?


So, I have this query which selects the number of rows in the past 30 days:

            SELECT COUNT( DATE_FORMAT( created_at, '%m/%d/%Y' ) )
            FROM    enc_encounters
            WHERE   created_at BETWEEN NOW() - INTERVAL 30 DAY AND NOW()";

I am trying to recreate this via query builder as such:

        $result = $this->select('DATE_FORMAT( created_at, \'%m/%d/%Y\' )')->whereBetween('created_at', ['NOW() - INTERVAL 30 DAY', 'NOW()'] )->count();

I am receiving a result of 0 (It is meant to return 3).

Any idea on where I am going wrong?

04 Jan
2 years ago

xdega left a reply on Laravel 5.1 Authentication Routes?

Upon looking through my Controllers, something doesn't seem to correspond with the routes.

I see the following structure, with no explicit AuthController per se:


I suspect that this may be the result of an inadvertent composer update or file deletion at some point, thus crushing my original code which properly matched the defined Auth routes in my web.php:

// Authentication routes...
Route::get('auth/login', 'Auth\[email protected]');
Route::post('auth/login', 'Auth\[email protected]');
Route::get('auth/logout', array('as' => 'logout', 'uses' => 'Auth\[email protected]'));

/* AUTH Registration Routes */
Route::get('auth/register', 'Auth\[email protected]');
Route::post('auth/register', 'Auth\[email protected]');

I just don't know where to begin at this point, because I am unable to find what the "AuthController" is meant to look like. The latest documentation doesn't seem to be very clear on this.

Could someone point me in the right direction?

xdega started a new conversation Laravel 5.1 Authentication Routes?

I just booted up a Laravel 5.1 project to begin working on it again, only to get a strange error when I try to log in. Note this DID work before.

The error I get is: Class App\Http\Controllers\Auth\AuthController does not exist

My routes.php has the same authentication routes copied from here: https://laravel.com/docs/5.1/authentication

03 Jan
2 years ago

xdega left a reply on Laravel Certification. 2017!

Also. Why isn't @JeffreyWay involved? ...or is he?

Could see Jeffrey being an excellent aide in providing focused study materials for the exam.

xdega started a new conversation Laravel Certification. 2017!

Just randomly searching Google for information on potentially certifying my passion of web development -- like you do -- and found this:


I can't wait! Really excited for this. Granted funding may be prohibitive unless I start to see some career success soon, I am making this is a goal for 2017.

Who else is excited about this?

xdega left a reply on Heroku

Funny you should ask.

I have been in tough times financially, and just spun up 4 free-hosted apps on Heroku as a way to archive my work as a portfolio for future employment.

So far so good. When the free dynos are sleeping, the delay is very significant. For something that costs $0, though, can't complain.

Certainly not good for full production, although I can't comment on the performance improvements of paid dynos. Heroku paid service appears to have great potential for a rapid, collaborative, team, who don't want to spend human capital on server management.

Heroku could be very useful for prototyping, and quick sparks of inspiration you wish to share with others. You can rapidly get your code up and running on a shareable live environment in minutes, without the hassle of setting up and managing a VPS.

03 Nov
2 years ago

xdega left a reply on State Management?


Thank you so much for hose clear examples. You are a rockstar! Makes a heck of a lot more sense to me now. Appears I was very close in my attempts.

xdega left a reply on Vue Js Lose Focus Event On Input

You can simply use the "blur" event. Like so:


02 Nov
2 years ago

xdega started a new conversation State Management?

So I have been struggling to wrap my head around the following article: https://vuejs.org/guide/state-management.html#Simple-State-Management-from-Scratch

I wish to implement shared data between multiple components and this was the suggestion.

How would I implement this within the setup of Laravel 5?

For example, where do I put:

const sourceOfTruth = {}
const vmA = new Vue({
  data: sourceOfTruth
const vmB = new Vue({
  data: sourceOfTruth


var store = {
  debug: true,
  state: {
    message: 'Hello!'
  setMessageAction (newValue) {
    this.debug && console.log('setMessageAction triggered with', newValue)
    this.state.message = newValue
  clearMessageAction () {
    this.debug && console.log('clearMessageAction triggered')
    this.state.message = 'action B triggered'

Does anyone know of a working example of this that I could use for reference?

Thank You.

31 Oct
2 years ago

xdega left a reply on Vue.js 2 And Laravel 5.3 Blank Page

Having been struggling with this issue myself. I finally got things working.

Following all the steps you followed will get you set up, expect for one vital step. Vue.js 2 attatched to #app (in bootstrap.js).

This means that your component must be wrapped with an appropriate div element that Vue.js can bind to:

                <div id="app">

Hope this helps.

PS: Feels good to actually be answering a question for once :D

xdega left a reply on Vue.js 2. Upgrade Guide?

That was the all-important step! I ran npm install laravel-elixir-vue-2 but never simply ran npm install to update all of the dependencies.

Thank you so much.

xdega started a new conversation Vue.js 2. Upgrade Guide?

So I have been working with Vue.js v1, and need to upgrade my dependencies to now move on and use Vue.js v2.

I have done the following: (1) Ran the migration-helper-tool and fixed all my syntax (2) Updated Elixir/Webpack to compile Vue.js v2 (3) Updated package.json, and ran composer update

Despite all of this, I am missing something. Here are some critical problems: (1) My gulp command now fails when trying webpack, since it is detecting Vue.js v1 (2) My components are not rendering due to the differences in syntax. (3) My Vue Dev tools are indeed detecting Vue.js v1

I feel like such a novice for asking this... What am I missing? How do I update my dependencies with Laravel? Is there are step-by-step install guide to update to Vue.js v2?

30 Oct
2 years ago

xdega left a reply on Correct Way To Do Transition In Custom Vue

@Laraveldeep Did you ever figure this out? I am currently having issues with this (See: https://laracasts.com/discuss/channels/vue/transistion-group-in-vue).

xdega started a new conversation <Transistion Group> In .vue?

So. Have just started learning/working with Vue.js and absolutely LOVE it! I have, however, ran into a perplexing issue when trying to work with transitions.

I have the following in my .vue file template:


            <li v-for="item in computedList"> 
                {{ item.name }} 

I receive this error: Unknown custom element: <transition-group> - did you register the component correctly?

I am following the documentation here: https://vuejs.org/guide/transitions.html#Staggering-List-Transitions

It turns out this person also had the same question -- about a month ago -- and received no response: https://laracasts.com/discuss/channels/vue/correct-way-to-do-transition-inside-custom-vue

19 Oct
2 years ago

xdega left a reply on Bootstrap Data-toggle Breaks With App.js

/facepalm. Nevermind. I got it fixed.

I should have just realized that app.js loads both JQuery and Bootstrap, and my issue would have been fixed sooner.

xdega started a new conversation Bootstrap Data-toggle Breaks With App.js

So I am running into this perplexing issue when creating a Bootstrap dropdown menu as part of a user/admin dashboard for my web app. I have the following in my dashboard view:

 <li class="dropdown">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i>            
    {{strtoupper(Auth::user()->name) }} <b class="caret"></b></a>
    <ul class="dropdown-menu">

This works just fine until I include at the bottom of the corresponding blade layout as such:

    <!-- Global Scripts -->
    <script src="/js/app.js"></script>

    <!-- jQuery -->
    <script src="/admin/js/jquery.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="/admin/js/bootstrap.min.js"></script>

I am not seeing anything in the console, the dropdown just fails to trigger. It doesn't appear to matter which order I include the app.js.

Does anyone know any reason that the inclusion of app.js would break my dropdowns?

21 Sep
2 years ago

xdega left a reply on Token + Domain Authentication?

@wells I just got done setting up OAuth 2.0 /w Passport. I must say that I am already glad I took this route. During the install process, I discovered that I was using an old version of Laravel. My dev environment was not reporting the PHP version that MAMP is running, instead was reporting the OSX version of PHP.

Due to following Taylor's video, I also went ahead and installed the user auth scaffolding, which ought to save me a significant amount of time and hassle. I am also going to be, belatedly, plunged into working with node.js and experiencing the glory of Vue components (Yay!), due to using an up-to-date version of Laravel. Just like all the previous versions, the framework never fails to impress me with the attention to emerging web standards and cutting edge libraries.

... in other words, I just want to express my sincere gratitude for your suggestion. I also apologize for my, somewhat arrogant, attitude when initially rejecting your suggestion.

18 Sep
2 years ago

xdega left a reply on Token + Domain Authentication?

I will carefully consider both options. Customizing the auth drivers does seem like it can get quite messy. I am just very hesitant to suddenly redesign the app database, when I potentially have other people working with me on this project.

17 Sep
2 years ago

xdega left a reply on Token + Domain Authentication?

I appreciate the suggestion, but the OAuth solution seems to be overkill for what I am trying to achieve.

I have a custom database design, and one part of that is a table called "token". All I am trying to do is have the basic HTTP auto driver look for token, as well as a domain. The functionality is already there to verify token, I just need to include the domain field also.

I would really rather not add a, somewhat, bloated layer of authentication. I am going for a simple, clean, and efficient solution here. For a very simple API application.

Is there no way to accomplish my suggestion without having to use OAuth?

16 Sep
2 years ago

xdega started a new conversation Token + Domain Authentication?

So I began working on my very first API-First web app project. I have managed to get basic token authentication working, with a separate "token" table for managing API tokens, but I have a problem.

Currently, the URL request works as such: http://localhost/api/v1/?api_token={token}

This is nice, but what I want to do, is have the authentication require TWO parameters, i.e: http://localhost/api/v1/?domain={domain}&api_token={token}

In other words, I don't simply want a user to be able to authenticate by using ANY valid key in the token table. I want them to authenticate using a valid Domain:Key pair (the token table contains both domain and key fields).

I looked around and couldn't find anything that specifically tells me how to make this amendment to the HTTP basic auth. I would rather not deep edit the Laravel code. What is the best way for me to go ahead and accomplish this?

22 Aug
3 years ago

xdega left a reply on App/storage Chmod 777 Safe?

I just used "chown apache:apache" on the directory and set the permissions as previously suggested. Everything is all working now. :D

xdega left a reply on App/storage Chmod 777 Safe?

And that fixed'ed it! An odd setup, but perhaps it will make things more secure. The last thing a hacker if going to expect, after probing my system and discovering the web-server is nginx. Thank you all for your help.

xdega left a reply on App/storage Chmod 777 Safe?

Very odd. I checked out my php-fpm.d and the user and group are defined as apache. How does that even work? My webserver is nginx!

xdega left a reply on App/storage Chmod 777 Safe?

I seem to be having issues running the touch command. Perhaps it is just my php setup. /shrug

xdega left a reply on App/storage Chmod 777 Safe?

...of course, the problem was the missing semi-colon of doom!

xdega left a reply on App/storage Chmod 777 Safe?

OK this may take a while. I ended up screwing my nginx config. I accidentally created 2 lines defining root. And even when I fixed the config, it still gives me the error.

When I look at all the users on my box, the only web user appears to be nginx. I am pretty sure that php-fpm is just being tunneled through the nginx user. I will look at this more for clarification once I get my config figured out.

xdega left a reply on App/storage Chmod 777 Safe?

Ok. I finally got around to setting those permissions. 700 for directories and 600 for files still gives me 500 server error. I also went ahead and set the chown to "nginx" which I believe to be the web user for nginx on centos7.

What would be my next step in troubleshooting? The problem seems to revolve around permissions.

20 Aug
3 years ago

xdega started a new conversation App/storage Chmod 777 Safe?

I just installed a fresh copy of Laravel 5. Everything seems to be going smoothly, only I was forced to set the permissions of my app/storage directory to 777 to fix a server error 500.

Is this safe?