theUnforgiven

theUnforgiven

Web Developer at NRS

Member Since 5 Years Ago

UK

Experience Points
285,450
Total
Experience

0 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
1618
Lessons
Completed
Best Reply Awards
45
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 50
285,450 XP
Feb
21
1 day ago
Activity icon

Replied to Adding Data To A Component From Another

For future me and anyone else.

I added

created() {
        Bus.$on('expenditure', (data) => this.addExpenditure(data))
    },

Then in the method added:

addExpenditure(data) {
            data.forEach((value, index) => {
                this.form.expenditureList.push(value);
            });
        },

Works perfect ;)

Feb
20
2 days ago
Activity icon

Replied to Adding Data To A Component From Another

Anyone know how to achieve this?

Activity icon

Replied to Adding Data To A Component From Another

So the event info:

name:"expenditure"
type:"$emit"
source:"<Root>"
payload:Array[1]
0:Array[2]
0:Object
1:Object

I need to push that into my form object on the parent, but as its an array, array object, do I need to map over these or is there an easier more sustainable way?

Activity icon

Replied to Adding Data To A Component From Another

Thanks, will check this out.

Activity icon

Replied to Adding Data To A Component From Another

So I have added an event to my child component <expenditure> as follows:

save() {
                this.$emit('expenditure', this.inputs);
                swal({
                    title: 'Expenditure',
                    text: 'The expenditure details have been saved, please continue.',
                    icon: 'success',
                    button: 'Continue',
                });
            },

Which if I view devtools I can see an array within the event. So in side my parent component <add-property> I need to get that event ideally when the continue button from the Sweet Alert is pressed. Which again I'm not sure how to do that.

Feb
19
3 days ago
Activity icon

Replied to Adding Data To A Component From Another

Ok, i’ll check this out. Or is there a simple way to pass what is in expenditure component to the parent another way? Not really to the form object but just so I can collect that data and post with axios.

Activity icon

Started a new Conversation Adding Data To A Component From Another

Hi all,

I have a component and inside this I have another

<div class="col-md-12">
        <expenditure></expenditure>  
</div>

So, my question is how can I add what comes from the expenditure component to the parent components form object?

Feb
18
4 days ago
Activity icon

Awarded Best Reply on Flatpickr And Calculate Date Lengths

Actually managed to just replicate

 updateEndDate() {
                var dates = this.form.start_date.selectedDates;
                var duration = this.form.duration;
                var startDate = moment(dates);
                var endDate = null;

                if (duration.length > 0 && startDate.isValid()) {
                    let durationInt = duration.replace(/\D/g,'');
                    let durationKey = duration.includes('years') ? 'y' : 'M';
                    endDate = startDate.add(durationInt, durationKey).subtract(1, "days");
                    
                    this.endDate = endDate.format('Do MMMM YYYY');
                } else {
                    this.endDate = '';
                }
            }

Useful for anyone else and my future self ;)

Activity icon

Replied to Flatpickr And Calculate Date Lengths

Actually managed to just replicate

 updateEndDate() {
                var dates = this.form.start_date.selectedDates;
                var duration = this.form.duration;
                var startDate = moment(dates);
                var endDate = null;

                if (duration.length > 0 && startDate.isValid()) {
                    let durationInt = duration.replace(/\D/g,'');
                    let durationKey = duration.includes('years') ? 'y' : 'M';
                    endDate = startDate.add(durationInt, durationKey).subtract(1, "days");
                    
                    this.endDate = endDate.format('Do MMMM YYYY');
                } else {
                    this.endDate = '';
                }
            }

Useful for anyone else and my future self ;)

Activity icon

Replied to Flatpickr And Calculate Date Lengths

This is what I had in jquery:

function updateEndDate() {
        var dates = $startDate.selectedDates;

        if (dates.length === 0) {
            return false;
        }

        var duration = $('#duration').val();
        var startDate = moment(dates[0]);
        var endDate = null;

        if (duration.length > 0 && startDate.isValid()) {
            durationInt = duration.replace(/\D/g,'');
            durationKey = duration.includes('years') ? 'y' : 'M';
            endDate = startDate.add(durationInt, durationKey).subtract(1, "days");

            $('#end-date .date').text(endDate.format('Do MMMM YYYY')).parent().fadeIn();
        } else {
            $('#end-date .date').empty();
        }
    }

    var $startDate = $("#start_date").flatpickr({
        dateFormat: 'J F Y',
        onChange: function (selectedDates, dateStr, instance) {
            return updateEndDate();
        }
    });

But I'm moving away from jQuery and want to replicate this working in Vue instead

Activity icon

Started a new Conversation Flatpickr And Calculate Date Lengths

Hi all,

I have a couple of inputs, one uses Flatpickr to select a date, and then the other has a list of tenancy lengths, ranging from 6 months to 5 years.

I want to know how I can calculate the length of these to show when the end date will be? So based on the screenshot, that should show as 24th August 2020, this is what I need to calculate and then show.

Feb
14
1 week ago
Activity icon

Replied to Npm Run Dev Stopped Working.....

You probably were, just me and my stupid eye sight in this case lol

Feb
13
1 week ago
Activity icon

Replied to Npm Run Dev Stopped Working.....

Think I figured it out....

I was referencing Vapor assets, rather than local assets. My bad, ignore me...

Activity icon

Replied to Npm Run Dev Stopped Working.....

Only these

So Vue is detected, but just not updating, even though laravel mix shows it compiled correctly!

Activity icon

Replied to Npm Run Dev Stopped Working.....

Yeah sure does I can see changes, but this is me trying to run dev locally not on any server. I'm using Valet and this use to work a few days ago, but now doesn't for some reason.

Activity icon

Replied to Npm Run Dev Stopped Working.....

Nope not me, I'm certainly in the right folder....

Activity icon

Started a new Conversation Npm Run Dev Stopped Working.....

Hi all,

For some reason running npm run dev shows that it's worked, but when I hard refresh I don't see the changes made in any of the Vue files I've made changes to. What could be the cause of this?

Feb
06
2 weeks ago
Activity icon

Replied to SES On Vapor

So it seems, thank you @themsaid I have since moved to Postmark for this. Really appreciate your help/advice on here and Twitter.

Feb
05
2 weeks ago
Activity icon

Replied to SES On Vapor

Ah, which ever London is as the region @themsaid that would explain it i guess.

But how do i get around this?

Activity icon

Replied to SES On Vapor

It seems like Sandbox was still enabled so I've sent a request to increase limits.

Activity icon

Replied to SES On Vapor

I've added email address and domain to AWS I can see Enabled for Sending: Yes & Status: verified just can't seem to crack why it won't send

Activity icon

Replied to SES On Vapor

Ok, think I have those set, I will double check.

Also do I need this sorta stuff in the env file?

MAIL_DRIVER=ses
[email protected]
MAIL_FROM_NAME="App Name"
Activity icon

Started a new Conversation SES On Vapor

Hi,

I'm trying to setup SES/SMTP to send emails from my application via SES and the site is on Vapor.

However, I have created a IAM user and policies to match, but I still get the following error:

 "message": "Failed to authenticate on SMTP server with username \"MYAPIKEY\" using 2 possible authenticators. Authenticator LOGIN returned Expected response code 334 but got code \"530\", with message \"530 Must issue a STARTTLS command first\r\n\". Authenticator PLAIN returned Expected response code 235 but got code \"530\", with message \"530 Must issue a STARTTLS command first\r\n\".",
    "exception": "Swift_TransportException",
Feb
04
2 weeks ago
Activity icon

Replied to Upgraded To 6 But Small Cache Issue [HELP]

Haha, thanks for help anyhow buddy Appreciated

Activity icon

Replied to Upgraded To 6 But Small Cache Issue [HELP]

Seems, i was in the wrong place, and I've now found it fml....

Activity icon

Replied to Upgraded To 6 But Small Cache Issue [HELP]

I have searched and commented out the 2 lines I think responsible which are,

// session()->put('phone_code', $code);
// session()->put('phone_mob', $phone);

But still the same error, so I'm like wtf!!

Activity icon

Replied to Upgraded To 6 But Small Cache Issue [HELP]

I did, and this is the result...Even with a brand new install. I;m still getting the same error, so it's clearly one of my files, but where and why isn't session/cache working as it did.

Activity icon

Replied to Upgraded To 6 But Small Cache Issue [HELP]

even after a brand new install took my controller across and all this worked on 5.8 so why as session() stopped working all of a sudden.....?? please help me

Activity icon

Replied to Upgraded To 6 But Small Cache Issue [HELP]

Hmm, refreshed to fix the service provider thing and now getting the cache issue again

Activity icon

Replied to Upgraded To 6 But Small Cache Issue [HELP]

Its cool figured it out

Activity icon

Replied to Upgraded To 6 But Small Cache Issue [HELP]

I am using cache() yes, changing to database, seems to work, but now I have another issue

lass 'App\Http\Controllers\Auth\RouteServiceProvider' not found",…}
message: "Class 'App\Http\Controllers\Auth\RouteServiceProvider' not found"
exception: "Symfony\Component\Debug\Exception\FatalThrowableError"
file: "/Users/lee/code/nrs/vendor/laravel/fram....

Activity icon

Started a new Conversation Upgraded To 6 But Small Cache Issue [HELP]

Hi all,

I upgraded a 5.8 app to 6 and now I get this error:

{message: "Cache store [request] is not defined.", exception: "InvalidArgumentException",…}
message: "Cache store [request] is not defined."
exception: "InvalidArgumentException"
file: "/Users/lee/code/nrs/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php"

But unsure what it is and how to fix it, help greatly appreciated.

Feb
03
2 weeks ago
Activity icon

Awarded Best Reply on Opening Times, Save To Db Correctly....

Scrap, that...

collect($request->get('opening_hours'))->each(function ($value, $key) use ($company) {
                $key = 'opening_hours_' . $key;
                $company->{$key} = $value;
            });

Works just fine

Activity icon

Replied to Opening Times, Save To Db Correctly....

Scrap, that...

collect($request->get('opening_hours'))->each(function ($value, $key) use ($company) {
                $key = 'opening_hours_' . $key;
                $company->{$key} = $value;
            });

Works just fine

Activity icon

Started a new Conversation Opening Times, Save To Db Correctly....

Hi all,

Hope everyone as had a good start to the week...

I have a question I can't seem to figure out. I have the following form, just Monday and Tuesday for now, but it will be all 7 days of the week.

Question is how do I save these values? I have columns in my db for the days of the week, but I want to save the am and pm values or closed value if the check box is checked.

If I dd the request I get:

array:2 [▼
  "monday" => array:2 [▼
    "am" => "7:00"
    "pm" => "16:00"
  ]
  "tuesday" => array:2 [▼
    "am" => "8:00"
    "pm" => "17:00"
  ]
]

So how would one save these to the appropriate columns in the db?

Thanks in advanced ;)

Activity icon

Replied to Subdomain Using Vapor

Ah! I see, thank you @themsaid i will give this a try. Vapor is cool 😉😉😉

Activity icon

Replied to NPM Error On Vapor

So it doesn’t need to be there in order to deploy the node modules folder?

Feb
02
2 weeks ago
Activity icon

Started a new Conversation NPM Error On Vapor

Hi all,

Trying to setup a production env on Vapor and I get the following error:

 The command "npm install && npm run production && rm -rf node_modules" failed.

  Exit Code: 2(Misuse of shell builtins)

  Working directory: /Users/lee/code/nrs/.vapor/build/app
Activity icon

Replied to Subdomain Using Vapor

Thing is I don't really want to add the main domain if I can help it as it's wordpress based. Just want to add the sub-domain.

Activity icon

Replied to Subdomain Using Vapor

Thanks @ahmeddabak I'll check this out

Activity icon

Started a new Conversation Subdomain Using Vapor

Hi all,

I want to use a subdomain and not the main domain on Vapor, however since the main domain is Wordpress, which I will need to know how to setup on Vapor too if anyone knows how. I just just want subdomain setting up for now, Is there a way to do this??

Thanks in advance

cc @themsaid

Jan
28
3 weeks ago
Activity icon

Replied to Accounting Table, Unsure...

Anyone know how i can do this

Jan
27
3 weeks ago
Activity icon

Replied to Accounting Table, Unsure...

It also needs to use dates to check if the current month is one of the month mentioned in the table

Activity icon

Started a new Conversation Accounting Table, Unsure...

Hi all,

I need to replicate the following data into a table, with different sets if user inputted data, like so:

I'm sure on how to achieve this and the database structure should be like then also how to get the table to look like the above.

Any help/advice greatly appreciated..

Jan
26
3 weeks ago
Activity icon

Replied to Editable Table But Save All Values

Great, thanks. I will try this out is was more the js part i was having a problem with. Thanks buddy

Activity icon

Replied to Editable Table But Save All Values

Can anyone help me on this please?

Jan
24
4 weeks ago
Activity icon

Started a new Conversation Editable Table But Save All Values

Just hit a roadblock, I have a table quite a big table too, and most cells are editable, but I want to click a submit button and save all the values in the all the cells.

Here's what I currently have:

 $(".edit").focusout(function(){
        //$("#sub").click(function() {
            $(this).removeClass("editMode");
            var id = this.id;
            var split_id = id.split("_");
            var field_name = split_id[0];
            var edit_id = split_id[1];
            var value = $(this).text();


            $.ajax({
                url: '/claim/store',
                type: 'post',
                data: { field:field_name, value:value, id:edit_id },
                success:function(response){
                    console.log('Save successfully'); 
                }
            });

        });

Which works but only does one cell at a time and fo the ajax post I need to send everything through so I can encode it and save to the db.

I have this is a Laravel blade foreach:

@foreach($costItems as $key => $cost)
                    <tr>
                        <td>{{ $key }}</td>
                        <td colspan="6">{{ $cost}}</td>
                        <td contentEditable="true" class="edit" id="total_budget_{{ $key }}"></td>
                        <td contentEditable="true" class="edit" id="q1_{{ $key }}"></td>
                        <td contentEditable="true" class="edit" id="q2_{{ $key }}"></td>
                        <td contentEditable="true" class="edit" id="q3_{{ $key }}"></td>
                        <td contentEditable="true" class="edit" id="q4_{{ $key }}"></td>
                        <td contentEditable="true" class="edit" id="q5_{{ $key }}"></td>
                        <td contentEditable="true" class="edit" id="q6_{{ $key }}"></td>
                        <td contentEditable="true" class="edit" id="q7_{{ $key }}"></td>
                        <td contentEditable="true" class="edit" id="q8_{{ $key }}"></td>
                        <td contentEditable="true" class="edit" id="q9_{{ $key }}"></td>
                        <td contentEditable="true" class="edit" id="q10_{{ $key }}"></td>
                        <td contentEditable="true" class="edit" id="q11_{{ $key }}"></td>
                        <td contentEditable="true" class="edit" id="q12_{{ $key }}"></td>
                        <td contentEditable="true" class="edit" id="project_total_{{ $key }}"></td>
                        <td contentEditable="true" class="edit" id="variance_{{ $key }}"></td>
    </tr>

Any help greatly appreciated in order to save all the edited values in one go.

Dec
28
1 month ago
Activity icon

Replied to VueDraggable Help

Does anyone have any ideas on this?

Dec
27
1 month ago
Activity icon

Started a new Conversation VueDraggable Help

Hi all,

Merry Christmas one and all.....

I'm using the Vue Draggable package to make a Kanban style board, however the first list shows according to what I specify from Laravel, but like Trello I have columns 3 in fact and I want to be able to update each issue item to different columns.

Here's the code I currently have:

<draggable @change="update" :list="list" group="lists" :column="1">
                    <ul class="pt-1 pb-3 px-3" v-for="(issue, index) in issues"
                    :key="issue.id">
                        <li class="block p-5 bg-white rounded shadow mt-4">
                        <a :href="'/issues/' + issue.uuid ">
                            <div class="flex justify-between">
                                <p class="text-sm font-medium text-gray-900 leading-snug">{{ issue.title }}</p>
                                <span>
                                    <img
                                        class="h-6 w-6 rounded-full" 
                                        src="https://images.unsplash.com/photo-1456327102063-fb5054efe647?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&facepad=3&w=144&h=144&q=80">
                                </span>
                            </div>
                        </a>
</li>
                    </ul>
                </draggable>

Then I have two more divs setup for the other 2 blank columns.

<div class="ml-3 flex-shrink-0 flex flex-col w-80 bg-gray-100 rounded-md">
          <h3 class="flex-shrink-0 pt-3 pb-1 px-3 text-sm font-medium text-gray-700">
            In Progress
          </h3>
          <div class="flex-1 min-h-0 overflow-y-auto">
            <draggable @change="update" :list="list2" group="lists" :column="2">
                
            </draggable>
          </div>
        </div>

        <div class="ml-3 flex-shrink-0 flex flex-col w-80 bg-gray-100 rounded-md">
          <h3 class="flex-shrink-0 pt-3 pb-1 px-3 text-sm font-medium text-gray-700">
            Done
          </h3>
          <div class="flex-1 min-h-0 overflow-y-auto">
            <draggable @change="update" :list="list3" group="lists" :column="3">

            </draggable>
          </div>
        </div>

but dragging an item from col 1 to col 2 doesn't do anything, so I'm looking for some help advice on how to do this please if anyone else as managed to do this sort of thing. I have a column column in my database as well as an order column.

Help, greatly appreciated.

Nov
18
3 months ago
Activity icon

Replied to Str Limit Using QuillJS

Thanks all Str::words did the trick