CarlEOgden

CarlEOgden

Member Since 4 Weeks Ago

Experience Points
380
Total
Experience

4,620 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
0
Lessons
Completed
Best Reply Awards
0
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 1
380 XP
Nov
19
1 day ago
Activity icon

Started a new Conversation Why Can I Not Access A Variable In Laravel Blade

Hi

I've chopped this code:

https://jsfiddle.net/CarlOgden/xtnrcmpz/10/

To put in my website, the first stage of my plan is to display a clock, once I get this to display, I will then create a popup notification when calendar items are due but first things first!

In application.js

import ComponentSoClock from './components/so-clock';
Vue.component('so-clock', ComponentSoClock);

In my blade, I have

<so-clock></so-clock>
<button class="header__divider header__padding header__link button-link has-icon toggle">
    <svg class="has-icon__icon">
        <use xlink:href="{{ asset('img/app.svg') }}#bell"></use>
    </svg>
    <template id="so-clock-template">
        <strong>{{ timeStamp }}</strong>
    </template>
</button>

in so-clock.js I have:

export default {
    name: 'so-clock',
    template: '#so-clock-template',
    props: {},
    data() {
        return {
            timeStamp: '',
        };
    },
    created() {
        setInterval(this.getNow, 10000);
    },
    methods: {
        getNow() {
            const today = new Date();
            const time =
                today.getHours() + ':' + (today.getMinutes() < 10 ? '0' : '') + today.getMinutes();
            this.timeStamp = time;
            console.error(this.timeStamp);
        },
    },
};

Every 10 seconds in Console I see the clock update and display the time. it doesn't need to run every second, it's not as if we really need yet another clock on a computer!

I cannot get either the clock to display, nor access either $timeStamp or {{ timeStamp }} to display the clock.

Can someone please let me know what I've done wrong?

Thanks in advance Carl.

Nov
12
1 week ago
Activity icon

Awarded Best Reply on Accessing .tag In PHP Variable

Solved it!

We have implemented this routine with an addon which excludes all the .tag attributes so I was chasing my tail!

Cheers Carl.

Activity icon

Replied to Accessing .tag In PHP Variable

Solved it!

We have implemented this routine with an addon which excludes all the .tag attributes so I was chasing my tail!

Cheers Carl.

Activity icon

Replied to Accessing .tag In PHP Variable

Hiya

Unfortunately, it's in a php file that doesn't seem to accept the existence of "dd" or "@dd" and so just crashes the function.

As this whole routine is built around a blade and then templates, it seems that the template can't be debugged at a level to get the results of either $dropbox_file or $file (the variable this routine returns to then display these variables). To a novice as I am, this is all very consfusing!

Debugging PHP vars is a pain!

All I've managed to work out with an isset is that $dropbox_file->error['.tag'] or even $dropbox_file->entries['.tag'] as this is what is listed as being returned in the dropbox api documentation.

Any help on other ideas of debugging php variables is welcome :)

Cheers Carl.

Nov
11
1 week ago
Activity icon

Replied to Accessing .tag In PHP Variable

Hi

I've got it working without crashing:

$file->tag = $dropbox_file->error[".tag"];

BUT, it comes back as an empty variable!

Ah Well! Onwards!

Carl.

Activity icon

Replied to Accessing .tag In PHP Variable

Hi

In all honesty I do not know!

I am working with a system someone else designed and built and has now left the company.

We are calling the dropbox api to get the directory listing so in this link:

https://www.dropbox.com/developers/documentation/http/documentation

And do a search for .tag you'll see that it is referenced around 725 times!

In most of them it's the first element in what you receive back and as it's described as ".tag" then all the rest of the variables don't seem to be in quotes or with . at the start of them!

Also, I'm struggling (due to lack of knowledge) on how to debug the variables, as this php routine is called when you click on a tab in the browser, it's made up of a template from within a blade (might even be within a blade) so we can never find the variable when we do a  @dd(get_defined_vars()); we never see the variable $file or fileList which is referenced!

I seem not to be able to get information from the php part but if I am editing the .js files, a simple console.error(variable) gives me what I want. Even doing a console.dir(window) in the console once the screen has draw doesn't get me the variable list I'd expect to see!

Hope the above doesn't confuse too much!

Cheers Carl.

Nov
08
1 week ago
Activity icon

Started a new Conversation Accessing .tag In PHP Variable

Hi

I've got the following routine and I would like to know if the .tag = "folder" or not!

Any help on me fixing this:

                    $file = new \stdClass();

                    $file->id   = $dropbox_file->id;
                    $file->name = $dropbox_file->name;
                    $file->size = \StringHelpers::formatBytes($dropbox_file->size);
                    #$file->tag = $dropbox_file['.tag'];
                    if ($dropbox_file[".tag"] == 'folder') {
                        $file->tag = 'folder';
                    }else {
                        $file->tag = 'file';
                    }

I cannot get $dropbox_file['.tag'] or $dropbox_file[".tag"]

Thanks in advance Carl.

Activity icon

Started a new Conversation Debugging Variables In A Php File

Hi

I've got a php script that reads files from a dropbox account and then using Vue, displays them.

We have added a feature to create a new folder and move through them.

However, we load all the dropbox information (filename/size/date) into an array, called $files.

I'd like to see what's inside this variable and all the arrays.

As I am new to php/js programming especially in a Laravel/Vue system, am struggling getting the variables out!

I have a blade that uses templates to build the screen and within one of the templates, if I do a @dd(get_defined_vars()); in some of the (as it were - higher templates) templates I either get a lot of variables but not the $file and if I place it further down the templates (as it were) I just get a white screen and it doesn't do anything!

Alternatively, when the php file creates and builds the variable $files, I can't output anything from the php file to the console, is there an easy way of debugging?

It's all rather frustrating!

Thanks for any and all help Carl.

Oct
24
3 weeks ago
Activity icon

Replied to Accessing What's Been Selected In A Drop Down List

Hi

Thanks for your reply, it's an inherited system (I am the new one) and working perfectly, but, we'd like to add to the form so am trying to amend this.

I think that I can't do what I want to do because it's in a blade and not a vue, if I change the above select from the way the previous guy did it to a standard one and get that working, if I add v-model to the select, it stops rendering the screen or if I add @{{ companyName }}, again, it stops rendering!

I might have to go back to the drawing board and start elsewhere :)

Regards Carl.

Activity icon

Replied to <Select> Issue

Hi

Thanks for that, if I do that, the page stops rendering so I can only presume this part of the website/app isn't using Vue so it isn't available!

Cheers Carl.

Oct
23
4 weeks ago
Activity icon

Started a new Conversation <Select> Issue

Hi

I've marked this as a Vue issue but not sure if it is Laravel! Am new to all this!

In my blade (which is called from another blade) I have the following:

<div class="row" class="col-med-33 col-50">
    <select class="form__select" label="Existing Solicitors" id-prefix = "solName" name="solName">
        <option value="">Please select...</option>
        @foreach($solicitors as $contact)
            <option value = "{{ $contact->fldCompanyName }}">{{ $contact->fldCompanyName }}</option>
        @endforeach
    </select>
    {{-- <span>Selected: {{ solName }}</span> --}}
</div>

If I add v-model="solName" to my line, the form doesn't load.

No matter what I do, I cannot get to display the solName in {{ solName }} to change when I select anything in the drop down box.

Anybody point me in the right direction?

What I'd like to do is select a contact and go off and populate another select with data and show that!

Cheers in advance Carl.

Activity icon

Started a new Conversation Accessing What's Been Selected In A Drop Down List

Hi

Sorry for basic silly questions, but I have a blade that draws a drop down as follows:

                        @include('partials.input', [
                            'label'    => 'Solicitor Name',
                            'type'     => 'select',
                            'values'   => $solicitors,
                            'key'      => 'fldCompanyName',
                            'model'    => 'fldCompanyName',
                            'content'  => 'fldCompanyName',
                            'columns'  => 'col-med-33 col-50',
                            'required' => true
                        ])

It's populated with:-

  "solicitors" => Collection {#900 ▼
    #items: array:8 [▼
      0 => {#901 ▼
        +"fldCompanyName": "ABC"
        +"fldAddress": """
          1 Stockton Drive,
          Bury,
          Lancashire
          """
        +"fldCountry": "England"
        +"fldPCode": "BL8 1UQ"
      }
      1 => {#902 ▶}
      2 => {#903 ▶}
      3 => {#904 ▶}
      4 => {#905 ▶}
      5 => {#906 ▶}
      6 => {#907 ▶}
      7 => {#1095 ▼
        +"fldCompanyName": "*** Not Listed ***"
      }
    ]
  }

My questions are:

Can it be linked with the v-model (I presume incorrectly by adding model in the list would allow me access but it doesn't How do I access what's been selected?

Also, is this the best way to populate a drop down list with the variables from $solicitors as what I'd like to do is:

If *** Not Listed *** hide the dropdown and show some text boxes to enter company/address/postcode If ABC then hide the dropdown but populate text boxes with the additional fields

Thanks in advance for any/all help given! Cheers Carl.

Oct
22
4 weeks ago
Activity icon

Replied to Adding To A Collection

Perfect!

Thank you very much.

Cheers Carl.

Activity icon

Replied to Adding To A Collection

Hi

I need to add "*** Not Listed ***" to the end as I then want to show/hide different screen options.

I am trying to stop the user from creating multiple solicitors so forcing them to either look for an existing one or select this option having been through the list and deciding to then create the solicitor.

If they do select a solicitor, then I want to show/hide other options - such as a list of all the solicitor names and again, if that solicitor contact does not exist, let the user then create the contact.

Our system allows too much data duplication so changing the way it operates!

HTH Carl.

Activity icon

Started a new Conversation Adding To A Collection

Hi

I've got a routine that pulls solicitors information from a database and populates the variable "$solicitors", when I perform a dd I get the following collection information:

   "solicitors" => Collection {#900 ▼
    #items: array:7 [▼
      0 => {#901 ▼
        +"fldCompanyName": ""
        +"fldAddress": "1 Hemley Close"
        +"fldCountry": "England"
        +"fldPCode": "BL5 2JB"
      }
      1 => {#902 ▶}
      2 => {#903 ▶}
      3 => {#904 ▶}
      4 => {#905 ▶}
      5 => {#906 ▶}
      6 => {#907 ▼
        +"fldCompanyName": "my solicitors"
        +"fldAddress": """
          Rossendale,
          Lancashire
          """
        +"fldCountry": "England"
        +"fldPCode": "BB4 5GH"
      }
    ]
  }

My routine is a simple one:-


function getSolicitors($id) {
    $solicitors = \DatabaseHelpers::callProcedure('GetSolicitorCompanyNamesForAgency', [':agency_id' => $id]);

    return $solicitors;
}

Now then, how can I add one that would allow fldCompanyName = "*** Not Listed ***" in element 7? But as I am new to this programming environment I just can't work it out!

Thank you in advance for any and all help given.

Regards Carl.