Xsecrets

Xsecrets

Member Since 4 Years Ago

Experience Points
66,775
Total
Experience

3,225 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
654
Lessons
Completed
Best Reply Awards
5
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 14
66,775 XP
Sep
03
1 month ago
Activity icon

Commented on Lazy Collections

that's funny in mine it says in 36 minutes.

Aug
30
1 month ago
Activity icon

Replied to How Access To Index Of Another Element (v-for)

it would work if the second div is inside the first, but with it outside there is no way it could possibly know which index you are wanting.

Activity icon

Replied to Inefficient Query How To Impove Number Of Queries

Couldn't you simply move the get() to your initial variables and pass the resulting collection into the map so that you are simply filtering the collection on each pass instead of passing a query into the map function and running the query on each pass?

May
14
5 months ago
Activity icon

Replied to Eloquent Each Method Won't Return Any Value From The Collection

The only return that the each collection method accepts is false to stop processing. The way you are trying to do things is strange, but to get data from the dump I think you would want a map function instead of each.

May
08
5 months ago
Activity icon

Replied to How To Improve The Speed Of A Laravel Page That That Queries For A Large Amount Of Data

  1. how long does the actual database query take? It might not be your issue.
  2. there is another thread on here somewhere that someone was using Aurora DB and accessing it via hostname which seemed to be the issue. From troubleshooting it looked like the dns lookup took up to 1600ms. It could well be that the dns lookup and connection to your db is taking up most of the time if you find from 1 that the query itself runs fast.
Activity icon

Replied to ReflectionException Class App\Http\Controllers\User Does Not Exist

The initial error doesn't have anything to do with your controller. It's because you did not add a use statement for your User model, but then you tried to inject it in your functions like edit(User $user), so it looked in your current namespace for the class and it does not exist. To fix it at the top of the controller file with the other use statements add

use App\User;

That's assuming you are using the default User model.

Apr
30
5 months ago
Activity icon

Replied to Deleting Parent Model Without Cascade

found in on stack overflow from a google search, actually two searches. I searched for sql on delete options then when I found the null option I searched for laravel foreign key on delete set null.

Activity icon

Replied to Deleting Parent Model Without Cascade

->onDelete('set null');

Activity icon

Replied to Help Needed With First Time Design

no guzzle uses sync not async, and it uses curl in the background to make the requests.

Apr
26
5 months ago
Activity icon

Replied to All Tests Broke Down In The Cloned Version Of Project.

Well it's clearly some sort of mockery error. Are you using mocks in any of your tests? maybe looking at that code will reveal what is missing/different on the other machine

Activity icon

Replied to All Tests Broke Down In The Cloned Version Of Project.

and you do have mocker/mockery in your dev dependencies in composer.json? I made the mistake of removing it once and got similar errors.

Activity icon

Replied to All Tests Broke Down In The Cloned Version Of Project.

did you do composer install? if so make sure you did not use the --no-dev flag, because mockery is a dev dependency and required for tests

Activity icon

Replied to Slow Queries/connections With Eloquent, Always Over 1600ms

yeah I don't know about aurora, but accessing the db from dns could cause the problems you are describing. because there will need to be a network call to get the ip for the db. if you can't use ip you could try editing the /etc/hosts file and adding that domain name in there to eliminate the network call and see if that helps.

Activity icon

Replied to Laravel Forge - Nginx Respond On IP

I don't know how to do it off the bat, but if you spin up a new server and look at the default site that will answer on the ip so you should be able to look at that nginx file. I have removed all my default sites so I can't currently look.

Apr
23
5 months ago
Activity icon

Replied to Creating A Contact Form Without Controllers And Migrations

If you really don't want to have a controller you could always send the mail in an anonymous function in your routes file, but the mail will need to be sent from the server not the client, so you can't really put it in blade.

Apr
04
6 months ago
Activity icon

Replied to Can I Use One Middleware To Restrict Access To Multiple Routes?

of course. I generally create a route middleware, then in my routes file I create a group and apply the middleware to the group and put the individual routes inside the group.

Activity icon

Replied to Overwrite Nginx Content-Security-Policy Within PHP?

sorry mixing up all the stupid web security stuff that starts with C. I don't know if you can overwrite headers set my nginx, but my gut instinct would be no you need to change it in the nginx config.

Activity icon

Replied to Overwrite Nginx Content-Security-Policy Within PHP?

If you are a member the latest vue spa video covers this.

Activity icon

Replied to Id Incrementation Problem

in mysql directly it would be something like ALTER TABLE MyTable AUTO_INCREMENT=100; not sure if that works on other databaes like postgres.

Apr
03
6 months ago
Activity icon

Replied to Comparing Factory To Eloquent Model

@YOERIBOVEN - well from your code I don't see anywhere that you associate the settings with the user, so the false return from the is method is correct in this case. though I'm not sure what you are doing in the controller from that post. My guess is if you associate a setting with the user it's not the same setting you just created. If you do create a setting and associate it with the user in that controller and you are using refresh database trait so you know there is no other data in the database you could do the call then do something like $settings = Settings::all()->first(); My guess in this case if you do create one in your controller if you did Settings::all()->count() you would find out you have two when you would expect one.

Activity icon

Replied to Comparing Factory To Eloquent Model

so if you had something like

$user = factory(User::class)->create();
$setting = factory(Setting::class)->create(['user_id' => $user->id]);
$this->assertTrue($setting->is($user->setting); 

should pass, and if you are creating the db entries in some other way shouldn't matter as long as $user and $setting are eloquent models it should work.

Activity icon

Replied to Comparing Factory To Eloquent Model

Well you didn't show any code how anything was created so I don't really know what type of objects you have for $settings and $user, but if both of those are eloquent objects the comparison I posted should work.

Activity icon

Replied to Vue Vs Jquery With Laravel... An Honest Performance And Easy Of Use Comparison

Yes in this instance basically the difference is that in the code you show you are returning html and adding that to the dom. With Vue you would simply return json data and update a variable and vue would take care of updating the dom for you. Honestly in my experience Vue does take a bit more setup code that jquery, however once you get into things of any complexity Vue starts using much less code than jquery. Plus I don't really like passing html like you have done, nor do I enjoy digging into and updating the dom through vanilla javascript from raw data.

Activity icon

Replied to Comparing Factory To Eloquent Model

$this-assertTrue($settings->is($user->settings));
Activity icon

Replied to General Question: How Do I Identify Where My Error Has Originated?

I would say the error has to do with this line. $data = DB::table('adjustments')->where(['toPID','=',auth()->user()->PID])->get(); the error is clearly from a select statement very similar to that. I would hard code auth()->user()->PID for testing to see if the error goes away, or log auth()->user()->PID to see if it contains what you think it does.

Apr
02
6 months ago
Activity icon

Replied to Any Ideas How To Extract Certain Fields After A GroupBy() On A Collection?

oh sorry I didn't see that. So just move the groupBy before the get and it should work because groupBy is also a query method, Though I'm not sure that is going to return the same data. The other option would be to do a map operation on the results to return only the data you want.

Activity icon

Replied to Any Ideas How To Extract Certain Fields After A GroupBy() On A Collection?

so you want it grouped by scooter_id, but inside you only want lat/long? You should be able to simply remove scooter_id from the select.

Activity icon

Replied to Accessing Localhost From My Iphone?

Well your phone can't access via localhost, but since you are on a macbook you might want to look into valet instead of php artisan serve. Valet has a share functionality that will give you a link your iphone can connect to.

Nov
07
11 months ago
Activity icon

Replied to All Problems With The New Laracasts Design

I love the look of the new design, but I must say not having any sense of your completion level on the series browse or the watchlist is a bit of a pain.

Jun
18
1 year ago
Activity icon

Replied to Data Property Not Being Updated From Created Method What Am I Doing Wrong

Thanks, that was it. I was actually in testing so a timeout without a time actually did it. I already had my test in a nextTick which I thought would be enough, but apparently not.

Activity icon

Started a new conversation Data Property Not Being Updated From Created Method What Am I Doing Wrong

I have code similar to the following and it's not working. I just can't figure out why. I was thinking it was a scope issue, but as far as I can tell that is not the case.

<template>
    stuff here
</template>

<script>
    export default {
        props: {
            clientData: { default:null }
        },
        data () {
            return {
                client: this.clientData,
                clientList: 'initial value'
            }
        },
        methods: {
            fetchClientList() {
                window.axios.get("/clients").then(response => {
                    console.log(this); // returns vue component
                    console.log(this.clientList); // returns 'initial value'
                    this.clientList = response.data;
                    console.log(this.clientList); // returns proper data.
                });
            }
        },
        created() {
            if(!this.client) {
                console.log(this); // returns vue component matches the other one.
                console.log(this.clientList); // returns 'initial value'
                this.fetchClientList();
                console.log(this.clientList); // returns 'initial value' why is it not the valid data from above?
        }
    }
</script>

Any suggestions welcome.

Aug
04
4 years ago
Activity icon

Replied to Is A Subscription To Cartalyst Worth It?

Most all of the platform specific packages are based on framework independent libraries/packages, pretty much all the functionality can be used framework independent if you take the time to put it all together.