jaydeluca

jaydeluca

Member Since 3 Years Ago

Experience Points 39,500
Experience Level 8

500 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 274
Lessons
Completed
Best Reply Awards 17
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.

22 Sep
1 year ago

jaydeluca left a reply on Laravel 5.3 And Vue-table-2

@matfish2 awesome, i'll update and check it out.

By the way, thanks for building/maintaining this package. It has been extremely useful.

06 Sep
1 year ago

jaydeluca started a new conversation When Using The Spatie Backup Package To Backup To Dropbox, Occasional 502 Errors

i don't think this has anything to do with the Spatie package or Laravel itself, but I'm curious if anyone might have some insights into how to resolve the issue or where to start investigating. I'm guessing it's a dropbox error but I'm not sure how to troubleshoot that.

So basically every so often one of our backups will fail with the following error:

Exception message
Server error: `POST https://api.dropboxapi.com/2/files/get_metadata` resulted in a `502 Bad Gateway` response:
{"error": "Internal Server Error"}
Exception trace
#0 /home/forge/domain.com/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 /home/forge/domain.com/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 /home/forge/domain.com/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response),

Right now it's not a huge deal since we are running these backups hourly, and most of them succeed, but for peace of mind I'd like to eliminate the errors.

07 Aug
2 years ago

jaydeluca left a reply on Redevelop Existing Laravel Blade App Front End

  1. Yes in theory you could do whatever you'd like. It might be cleaner to try and do it all at once, but it sounds like that might take a while?

  2. If you already have experience with React then it would prob make sense to stick with something you know. Laravel does have Vue support yes, but it also has React support, it's just swapping out some stuff in your build process.

  3. Really depends on how complex / scattered the existing code is, and whether it's worth saving. Some of it might be able to be ported over to react which could handle the state/dom manipulation.

31 Jul
2 years ago

jaydeluca left a reply on So, Do You TDD?

Last week for work I had to write an algorithm to calculate a score based on a handful of metrics with unique point values. At first I figured i'd just dd($score) every time i made a change and check to make sure it was correct. I decided to write tests that went through each metric, and checked to ensure that the calculation was correct.

Before i'd add each calculation to the algorithm I'd write a failing test that checked for the correct answer, and then i'd try and get the test to pass after updating the algorithm.

It felt more efficient than writing random tests in the controller, only to be deleted afterwards (which is what my old non-tdd workflow would have been).

If I make new changes i don't have to go back to the controller and start from scratch. If you're new, maybe just focus on a handful of aspects of your application and then try and grow from there. I think you'll find it to be pretty helpful in the long run.

I'm also pretty new to TDD, but i'm trying to work it into my routine.

26 Jul
2 years ago

jaydeluca left a reply on Popular Searches

Are you logging searches? If not, then I'd create some kind of database table or storage mechanism to track the searches and go from there

12 Jul
2 years ago

jaydeluca left a reply on TDD Forum: User Activities

I'm a little confused about what "Activity" is and how it relates to the user. Can you give a little more overview of what you are trying to do? And you say it's not working, can you show an example of what the output is?

11 Jul
2 years ago

jaydeluca left a reply on TDD Forum: User Activities

I don't think you can pass a collection of user objects to the where like that.

You might be able to do something like

public static function allFeed($user, $take = 50) { 

    $otherUsers = $user->where('id', '!=', Auth::id())->get()->pluck('id');

     return static::whereIn('user_id', $otherUsers)
           ->latest()
           ->with('subject')
           ->take($take)
           ->get()
           ->groupBy(function ($activity) {
          return $activity->created_at->format('Y-m-d');
     });
}

jaydeluca left a reply on Laravel And Free Host

Hey @Aouiti your english is just fine!

What kind of hosting is it? It sounds like the .htaccess file might not be being used. Do you happen to know what kind of server it is?

jaydeluca left a reply on Storing Data Shared Between Elements.

@Roni I'm actually not sure if one of them is more efficient or optimal, It might just come down to preference. The props might be simpler since it doesn't require an external event bus

jaydeluca left a reply on Get Value From Form

Not sure how to do it with your {{!!Form!!}} tags, but if you were doing it with raw html i think you could do

<select name="location">
    @foreach($cities as $city)
        <option>{{ $city }}</option>
    @endforeach 
</select>

jaydeluca left a reply on Storing Data Shared Between Elements.

One sec, you aren't passing it, you are almost using an exception to handle that, so it bypasses the timing issue! Am I misreading? Emit => throw, and On is like a listen?

Sort of yes. The $emit "broadcasts" the event and data, and $on sets up a listener to catch and react to the event when it is triggered.

jaydeluca left a reply on Storing Data Shared Between Elements.

@Roni happy to help :)

One thing that I feel is important to know when working with vue, is that you will quite frequently run into situations where a variable isn't defined at the right time, and will cause your scripts to crash.

One thing to get into the habit of doing, is just adding a conditional check before trying to render it. So if for example you are trying to display a variable userName on a component, but you are getting the "cannot read property of undefined" (or whatever it is), you can get around it by doing something like this:

<template v-if="userName">
    {{ userName }}
</template>

That way you only try to render it once it's been set. When I was first starting out I struggled with this a ton.

Now back to your original questions, heres how you could go about doing this with props:

Your root vue instance:

new Vue({
    el: "#app",
    data: {
        passThisAlong: ''
    }

    created() {
        axios.get('api/call').then(res => {
            this.passThisAlong = res.data
        }
    }

    components: {
        'some-child-component': require('./components/SomeChildComponent')
    }

})

In the child components, include the props:

props: ['passThisAlong']

and in the child component template be sure to do what i talked about above:


<template v-if="passThisAlong">
    {{ passThisAlong }}
</template>

Wherever you implement the component:

<some-child-component :pass-this-along="pass-this-along" />

10 Jul
2 years ago

jaydeluca left a reply on Get Value From Form

but i want index value rather than index value so how i can fix it?

What?

What is the output you are getting? and what does a dd($cities) show in your controller?

jaydeluca left a reply on Storing Data Shared Between Elements.

There's two ways I can think of

  1. You do the API call in a parent component or root vue instance and pass the value down to the other components via props

  2. You set up an event bus vue object, and on your root vue object you run the api call, and when it completes you send an event:

axios.get('api/call').then(res => {
    eventBus.$emit('name-of-value', res.data);
}

and on your individual components:

created() {
    eventBus.$on('name-of-value', (value) => {
        this.variableName = value
    }

}

Let me know if you need more in depth explanation of the eventBus object for passing the event data around.

jaydeluca left a reply on Variable Available In Controller Undefined In View

change it to

return view( 'posts.show', compact('post') );
09 Jul
2 years ago

jaydeluca left a reply on How To Image Display In Blade File Dynamically

@Dhiren can you paste a screenshot of the outputted html element source in devtools or paste the html output itself so we can see what it looks like?

08 Jul
2 years ago

jaydeluca started a new conversation Has Anyone Else Had Issues With Sendgrid? Can You Recommend Some Alternatives?

I use sendgrid at my day job for all of our laravel applications, as it integrates so well and works great.

I am wrapping up a freelance project and went to create a new sendgrid account that I could use for this site and any other freelance projects, since I've had such great experience using it at work.

I signed up for the trial, configured my application with the credentials, and was unable to get it working. Then when I tried to log back in the sendgrid account to investigate and troubleshoot, I got the error an error saying I was not authorized and needed to contact support. I reset the password a few times and was still unable to login, so I sent support an email.

This was their response:

Good afternoon, Thank you for contacting SendGrid Support! I would be happy to help you! I am sorry to hear that you have been locked out of your account. SendGrid leverages many different vetting techniques and as such we've determined that you're not a good fit for our platform. Because of this, we will not be able to activate your account. Our system does not provide myself or other members of Support with details regarding decisions made in the sign-up process. As such we are not able to provide any more information to you. I apologize for this inconvenience. Kind Regards, SendGrid Support

I tried responding to the support ticket in order to inquire whether I am just not allowed to do a free trial or if I am banned from the entire platform for some reason, however since my account is blocked, I am unable to access the support ticket.

This is quite puzzling as the only thing i did was create an account, add my configuration to the .env file, and try and send a single test email.

Can anyone recommend some other services similar? I have no problem paying for this, as I do with my other account that I use.

jaydeluca left a reply on Laravel 5.4 Auth Always Gives A Failed Login Message For Every Single User Login.

It looks like your controller is looking for values with different names than your form.

in your controller you are looking for 'login-email' where in your form the input has the name 'email'

Try


public function login(Request $request)
{
    if (Auth::attempt(array('email' => $request->input('email'), 'password' => $request->input('password')))) {
        session(['email' => $request->input('email')]);
        return Redirect::back();
    } else {
        Session::flash('login-message', "Invalid Email or Password , Please try again.");
        return Redirect::back();
    }
}

jaydeluca left a reply on CSS BG Image Not Found, But Found When Clicked On Link

Let me clarify a little bit about the public folder thing.

If you are using shared hosting like godaddy, you might have an option to specify which folder your application lives in for your domain to point to. Instead of pointing it to your root folder, point it to: /domains/mysite.nl/htdocs/www/projects/zoekmachine/public

If you are using a VPS like digital ocean or aws, if you are using nginx, you would specify the same thing on the server level with your ngxin configuration, like so:

server {
    listen 80;
    listen [::]:80;
    server_name mysite.nl;
    root /domains/mysite.nl/htdocs/www/projects/zoekmachine/public;

My point is, your .htaccess file only works if you have configured your domain or server to point to the public directory

jaydeluca left a reply on SSH Key Generation On DigitalOcean Ubuntu 16.04 Droplet Connected With Forge

That is one of my only complaints about DO, is that using their built in console is a pain since you can't copy and paste into or out of it.

jaydeluca left a reply on CSS BG Image Not Found, But Found When Clicked On Link

So a couple things now that i look at this more.

You shouldn't have to access your site through /public. What kind of hosting are you using? You should point your domain to the public folder.

Once that is working, you should be able to just use a relative url for the image itself, so like:

background-image: url('/images/slider-ad-1.jpg');

jaydeluca left a reply on CSS BG Image Not Found, But Found When Clicked On Link

As a side note, your css scripts should be included at the top of the page, not the bottom

07 Jul
2 years ago

jaydeluca left a reply on Vue JS Watch Not Working

I've never seen vue written like that, so I could be off here, but I think it could stem from the quotations around your variable, so maybe try changing it to:

watch: {
  hex.value(val) {
    alert('This is not triggered');
  }
}  

Might be useful to take another look at the docs regarding watchers: https://vuejs.org/v2/guide/computed.html#Computed-vs-Watched-Property

06 Jul
2 years ago

jaydeluca left a reply on Laravel Valet Showing The Phpinfo Page In Every Domain!

what if you go into the public folder of one of your projects and do

valet link testsite

and then see if you can access it via testsite.dev

05 Jul
2 years ago

jaydeluca left a reply on Vue Says My Property Isn't Defined, But I Think It Is...?

I don't think you're setting your data object correctly, you have to return it:



var data = {
    blah: 'Hello World!',
}

const app = new Vue({
    el: '#app',
    data() {
      return data,
    }
});
03 Jul
2 years ago

jaydeluca left a reply on Struggling To Understand The Concepts Of Laravel And Frameworks, Can You Help?

Heres another try:

A company hires you to build an app. You spend a year building it without using a framework. The business is getting busier and busier, and the app needs more developers.

It is easier for a company to onboard more developers to work on an app that was built using a framework like Laravel, Code Igniter, Symphony etc with great documentation and learning resources than it would be to just hand over your spaghetti code 100% custom php application.

jaydeluca left a reply on Struggling To Understand The Concepts Of Laravel And Frameworks, Can You Help?

I've been unable to find "English" reasons for a framework.

@teckel didn't you say in one of your previous posts that your job is requiring you to move to Laravel? Sounds like that should be reason enough.

There have been pages and pages of explanations in the various threads. If you are still having trouble after all that and your "20 years" of php experience, you might want to consider a different career.

I'm not saying this to be mean or degrading or anything, but the web development world is rapidly changing and if you aren't even willing to learn something simple like composer, I'm not sure how you'd expect to be successful.

But maybe you'll get lucky?

jaydeluca left a reply on Unable To Continue Working

I have struggled with this as well, and what I found to help is trying to make it into a sort of game.

Do you use Github? Have you looked at your contribution history visual representation where every day is a box on a grid and the more commits you do, the greener it gets?

Try and get into the habit of at least 1 (quality) commit per day. Most of the time for me, I'll come up with a small task to complete, and then a couple hours later I realize that it had snowballed and I got way more done than I anticipated.

The visual representation makes it fun for me, and I've found it to be quite effective.

Everyone is different though. Hope this helps.

jaydeluca left a reply on I Need To Record In Two Tables (one To Many) In Laravel!

what happens if you dump the request object? In your controller do:

dd($request->all());

From there you should be able to see what is actually being sent by your form and then you can try and fix that accordingly.

It's pretty hard to read your code the way it is formatted (and due to most of it not being my first language), but why are you indicating the key of 0 for all of your arrays? Typically if you have a form that is going to populate an array you just do something like:

<input type="text" name="names[]">
02 Jul
2 years ago

jaydeluca left a reply on I Need To Record In Two Tables (one To Many) In Laravel!

I think you had some extra array brackets you didn't need:

$trechos_add[] = new Trecho(array('local_servico' => $local_servico,
               'local_pernoite' => $local_pernoite,
               'data_afastamento_inicio' => $data_afastamento_inicio,
               'hora_afastamento_inicio' => $hora_afastamento_inicio,
               'data_afastamento_retorno' => $data_afastamento_retorno,
               'hora_afastamento_retorno' => $hora_afastamento_retorno,
               'adicional_deslocamento' => $adicional_deslocamento,
               'total_acrescimos' => $total_acrescimos,
               'ck_valor_total' => $ck_valor_total,
               'valor_total' => $valor_total,
               'a_s' => $a_s,
               't_s' => $t_s,
               'houve_pernoite' => $houve_pernoite,
               'qt_pernoite' => $qt_pernoite
             ));

jaydeluca left a reply on Problems With Routing Using Valet

I was just able to set a test route using '/panel' without issue. Are you sure you set the route as GET as opposed to POST?

jaydeluca left a reply on I Need To Record In Two Tables (one To Many) In Laravel!

Try this instead of using that get() method

$diaria->trechos()->create($request->all());

jaydeluca left a reply on Laravel And Vue.js Instances On Different Page

@mikepmtl I'm not sure if this helps, but I have a side project application that I play around with that has some elements of what I think you are looking for.

https://github.com/jaydeluca/DigDat-Surveys

I have a single vue component as the parent, and individual components for different pages:

https://github.com/jaydeluca/DigDat-Surveys/blob/master/resources/assets/js/app.js

Here is how I implement them within a blade file: https://github.com/jaydeluca/DigDat-Surveys/blob/master/resources/views/pages/take-survey.blade.php

If you want to have data passed around you can set up the data in the root Vue object, and pass it to the children components via props. You can then use $emit and $on to set up event listeners for updating the data in the parent component when data changes if you need to.

Hope this helps somewhat. (the project is still a work in progress btw)

jaydeluca left a reply on I Need To Record In Two Tables (one To Many) In Laravel!

what is on line 88 of ParameterBag.php?

jaydeluca left a reply on Laravel - Is It Possible To Learn It In A Few Weeks?

@B00100447 I don't think theres a limit, do you have a link to the other thread and we could take a look?

30 Jun
2 years ago

jaydeluca left a reply on Is It A Good Idea To Make Admin Panel An SPA?

I built an admin panel using Laravel for auth and the api. Once logged in everything was served as a Vue.js SPA using Vue Router. No complaints here

28 Jun
2 years ago

jaydeluca left a reply on LWAP (Laravel Website As Package) - Tutorials

Might want to include a readme in your repo that tells people what it is and how to use it for people who might not be interested in watching the videos? Or even a link to the video series in the repo?

25 Jun
2 years ago

jaydeluca left a reply on [PDOException] SQLSTATE[HY000] [1045] Access Denied For User 'root'@'localhost' (using Password: YES)

Need some more information about your environment. Are you using a VM? Valet? MAMP/XAMP?

Have you created a mysql user account for the database with the credentials you are using?

jaydeluca left a reply on Edit Form In Laravel 5.4


<label class="label">Name:</label>
<p class="control">
    <input type="text" name="name" value="{{ $user->name }}" required>
</p>

21 Jun
2 years ago

jaydeluca left a reply on How To Always Load A Model Function When Retrieving The Model Instance?

You could try this (reference):

public function getAcceptedAttribute()
{
    return $this->attributes['accepted'] = $this->accepted();
}

protected $appends = ['accepted'];

20 Jun
2 years ago

jaydeluca left a reply on Are You All Using Vagrant ?

@Cronix your use case sounds like it wouldn't benefit from Valet.

But If you don't need that extra control, valet is great :)

jaydeluca left a reply on Are You All Using Vagrant ?

Mac or PC? Valet is insanely easy to use on Mac (haven't tried on PC)

jaydeluca left a reply on Vue 2 - Props Working Properly In One Template And Not Working Properly In Another

Can i see the code where you are implementing these components?

jaydeluca left a reply on Vue 2 - Props Working Properly In One Template And Not Working Properly In Another

Ok i have one more idea:

add a variable called 'dataLoaded' to your main root vue object:

data: {
            countries: [],
            dataLoaded: false
        },
    
        created() {
            this.getCountries(),
        },
    
        methods: {
    
            getCountries() {
    
                let self = this;
    
                axios.get('/admin/countries')
                    .then(function (response) {
    
                        self.countries = response.data;
            self.dataLoaded = true;
    
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
    
            },

Pass that as a prop as well and change your other component to:

Vue.component('pagination-list', {
    
        template: `
            <tfoot>
                <tr>
                    <td v-if="dataLoaded">{{countries.current_page}}</td>
                </tr>
            </tfoot>
        `,
    
        props: ['countries', 'dataLoaded']
    });

jaydeluca left a reply on Vue 2 - Props Working Properly In One Template And Not Working Properly In Another

sometimes that occurs when the data hasnt propagated down into the component. What I usually do is add a check like this:

Vue.component('pagination-list', {
    
        template: `
            <tfoot>
                <tr>
                    <td v-if="countries">{{countries.current_page}}</td>
                </tr>
            </tfoot>
        `,
    
        props: ['countries']
    });

18 Jun
2 years ago

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

@stephy does that mean you didn't run composer install? The error you are getting is related to composer. If you didn't install all the dependencies, and create the classmap, the code will not work.

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

Also I would be grateful if someone could explain how the instructor is able to use "forum.dev" in Hyperlink? Is he using xampp or similar?

He is using Laravel Valet but it is OSX only. Someone has created a windows version but i'm not sure how stable it is as I have not personally used it. But yes, it is similar to xamp in some ways

Were you able to run composer install without issue? Have you tried composer dump-autoload ?