theUnforgiven

theUnforgiven

Web Developer at NRS

UK

Member Since 4 Years Ago

Experience Points 261,930
Experience
Level
Lessons Completed 1422
Lessons
Completed
Best Reply Awards 45
Best Answer
Awards
  • 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

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    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.

14 Jan
6 days ago

theUnforgiven left a reply on JQuery Not Loading Or Vue Doesn't Load Depending On....

Also it isn't a case of converting all jQuery stuff to Vue, there's too many and not enough time to do that, although I do plan to do it in the future.

theUnforgiven started a new conversation JQuery Not Loading Or Vue Doesn't Load Depending On....

If I have this

<script src="{{ mix('js/oneui.app.js') }}"></script>

!-- Laravel JS -->
<script src="{{ mix('js/laravel.app.js') }}"></script>

at the top in the <head> section jQuery works but Vue doesn't.

And vice versa if it's at the bottom Vue works then jQuery doesn't, any reason for this and how best to fix?

theUnforgiven left a reply on Laravel Tinker Problem

Glad you got it sorted ;)

13 Jan
1 week ago

theUnforgiven left a reply on Laravel Tinker Problem

What commands are you typing and what does it show? Perhaps a screenshot or short video to show us all.

07 Jan
1 week ago

theUnforgiven left a reply on Running Supervisor On Mac With Valet?

I do have Horizon and Telescope installed, but just want a way for the queues and jobs to run without having to keep typing artisan queue:work

theUnforgiven started a new conversation Running Supervisor On Mac With Valet?

I'm wondering is there a way to auto run queues etc with Supervisor on a mac, I'm currently using Laravel Valet as it's nice and simple and effective to use, but rather than keep running 'artisan queue:work' every time I want something to run, how does one get Supervisor installed on a mac to do this?

06 Jan
2 weeks ago

theUnforgiven left a reply on Grouping Users Within Vue Chat

Anyone have any suggestions please?

04 Jan
2 weeks ago

theUnforgiven left a reply on Grouping Users Within Vue Chat

Anyone have any suggestions please

theUnforgiven started a new conversation Grouping Users Within Vue Chat

So this is the code I have to get users and associated tenants and agents (not sure if it's right either)

return User::orderBy('name')
                    ->where('id', '!=', auth()->user()->id)
                    ->with('companies', 'tenants', 'agents')
                    ->get();

Then within the Vue app this code:

<template>
    <div>
        <div class="row"> 
            <div class="col-md-3">
                <p class="float-left">Users</p><br /><br />
                <ul class="nav flex-column">
                    <li v-for="user in users"
                        class="nav-link"
                        :key="user.id"
                        @click="openChat(user.id)"
                        :class="{'font-weight-bold': chatUserID === user.id}">
                        <a href="#">{{ user.name }}</a>
                    </li>
                </ul>
            </div>
            <div class="col-md-9">
                <div class="row">
                    <div class="col">
                        <div v-show="loadingMessages">
                            <p>Loading messages... Please wait</p>
                        </div>
                        <div v-show="!chatOpen && !loadingMessages">
                            <p>Please click on user to start a conversation</p>
                        </div>
                    </div>
                </div>
                <div v-show="chatOpen && !loadingMessages">
                    <div class="row" ref="messageBox">
                        <div class="col-12 text-right shadow-sm" v-for="message in messages"
                             :class="{'p-3 mb-2 bg-secondary rounded text-white text-left': message.sender_id !== chatUserID}">
                            <small class="h6 text-right">{{ message.sender.name }}</small><br />
                            <small class="date">{{ message.created_at | formatDate }}</small>
                            <p class="font-weight-light msg rounded">
                                {{ message.message }}
                            </p>
                        </div>
                    </div>
                    <br />
                    <div class="row">
                        <div class="col col-12">
                            <div class="input-group mb-3">
                                <input type="text"
                                       class="form-control"
                                       placeholder="Start typing...."
                                       aria-label="New message"
                                       aria-describedby="button-addon2" v-model="newMessage"
                                       @keyup="typingIndicatorOn(user.name)"
                                >
                                <div class="input-group-append">
                                    <button class="btn btn-primary"
                                            type="button"
                                            id="button-addon2"
                                            @click="sendMessage">
                                        Send message
                                    </button>
                                </div>
                            </div>
                            <div :class="['dots', isTyping ? 'active' : '']">• • •</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
  export default {
    name: 'ChatApplication',
    data: () => {
      return {
        users: [],
        messages: [],
        chatOpen: false,
        chatUserID: null,
        loadingMessages: false,
        newMessage: '',
        isTyping: false
      }
    },
    created () {
      let app = this
      app.loadUsers()
    },
   
    watch: {
      messages: function () {
        let element = this.$refs.messageBox
        element.scrollTop = element.scrollHeight
      }
    },
    methods: {
        typingIndicatorOn (e, user) {
          if(_.indexOf(['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'], e.code) == -1){
            if(!this.isTyping){this.isTyping = true}
            _.debounce(this.typingIndicatorOff, 1600)()
          }
        },
        typingIndicatorOff () {this.isTyping = false},

      openChat (userID) {
        let app = this
        if (app.chatUserID !== userID) {
          app.chatOpen = true
          app.chatUserID = userID

          // Start pusher listener
          //Pusher.logToConsole = true

          var pusher = new Pusher('xxxxx', {
            cluster: 'eu',
            forceTLS: true
          })

          var channel = pusher.subscribe('newMessage-' + app.chatUserID + '-' + app.$root.userID) // newMessage-[chatting-with-who]-[my-id]

          channel.bind('App\Events\MessageSent', function (data) {
            if (app.chatUserID) {
              app.messages.push(data.message)
            }
          })
          // End pusher listener
          app.loadMessages()
        }
      },
      loadUsers () {
        let app = this
        axios.get('api/users')
          .then((resp) => {
            app.users = resp.data
          })
      },
      loadMessages () {
        let app = this
        app.loadingMessages = true
        app.messages = []
        axios.post('api/messages', {
          sender_id: app.chatUserID
        }).then((resp) => {
          app.messages = resp.data
          app.loadingMessages = false
        })
      },
      sendMessage () {
        let app = this
        if (app.newMessage !== '') {
          axios.post('api/messages/send', {
            sender_id: app.$root.userID,
            receiver_id: app.chatUserID,
            message: app.newMessage
          }).then((resp) => {
            app.messages.push(resp.data)
            app.newMessage = ''
          })
        }
      }
    }
  }
</script>

So basically I want to group users in the list by who are tenants and who are agents etc, then have a label above each group, how can this be achieved?

theUnforgiven left a reply on Time/Date When Queuing Notifications

So I figured I had to convert the date to unix by doing:

$when = Carbon::createFromFormat('Y-m-d H:i' , $request->alert_date ,'Europe/London');
$when->timestamp; 

Which seems to have solved the problem.

theUnforgiven left a reply on Time/Date When Queuing Notifications

So in essence I want the job processed at the time the user specifies i.e '"2019-01-04 10:40"'

theUnforgiven started a new conversation Time/Date When Queuing Notifications

Hi all,

Hope everyone had a great Christmas and New Year is off to a good start.

I'm looking for some help/advice. I have a basic form for adding tasks of which the user can specify a date & time the want to be notified at. So the string that comes back is as follows:

"2019-01-04 10:40"

When I then use with the following statement:

$when = $request->alert_date;
$user = User::find($id);
$user->notify((new TaskAlert($task))->delay($when))->onQueue('high');

But it appears when it adds to the database "jobs" table the unix time is wrong, thus sending the notification later than what it should, in this case "2019-01-04 10:40"

Any help/advice greatly appreciated.

19 Dec
1 month ago

theUnforgiven started a new conversation TailwindCSS Installed But JS Stopped Working

Hi all,

I have installed Tailwind and the relevant Tailwind.js file which is all good but now all the jquery and other JS stuff as stopped working.

I wondered if anyone else encountered this problem and how did you overcome it?

14 Dec
1 month ago

theUnforgiven left a reply on Multidimensional Array From Vue To Laravel

It does seem to be $reading->meter_type = $types[$i]; that was the problem. Commented this out and it works.

:(

theUnforgiven left a reply on Multidimensional Array From Vue To Laravel

For the Types I do have

<option v-for="(type, index) in reading_type" 
               :value="type.tags"
               :key="type.index" 
               :id="type.id"
>
    {{ type.value }}
</option>

theUnforgiven left a reply on Multidimensional Array From Vue To Laravel

Not validating any data so that wouldn't be a factor and those fields in question are just really "hard-coded" with the Vue template

<div class="row mt-2">
                        <div class="col">
                        <label>Gas Reading</label>
                        <input type="number" name="reading[0][0]" class="form-control">
                   
                        <label>Water Reading</label>
                        <input type="number" name="reading[0][1]" class="form-control">
                    
                        <label>Electric Reading</label>
                        <input type="number" name="reading[0][2]" class="form-control">
                    </div>
                    <div class="col">
                        <label>Reading Date</label>
                        <input type="date" class="form-control" name="reading_date[0][0]">
                
                        <label>Reading Date</label>
                        <input type="date" class="form-control" name="reading_date[0][1]">
                    
                        <label>Reading Date</label>
                        <input type="date" class="form-control" name="reading_date[0][2]">
                    </div>

as you can see edited to be reading[0][0] etc

theUnforgiven left a reply on Multidimensional Array From Vue To Laravel

I remember trying such thing this morning, and gives preg_match() expects parameter 2 to be string, array given error.

theUnforgiven left a reply on Multidimensional Array From Vue To Laravel

Ok, so how does one get that to work?

theUnforgiven left a reply on Multidimensional Array From Vue To Laravel

Hmmm, still shows as message: "Undefined offset: 2"

theUnforgiven started a new conversation Multidimensional Array From Vue To Laravel

I'm having a bit of brain freeze and can't figure out how to get the data from these two forms from VueJS to save with Laravel.

Here's the code with VueJS

<label>Reading Type</label>
<select name="reading_type[]" class="form-control">
    <option value="">Please Select</option>
    <option v-for="(type, index) in reading_type" 
            :value="type.tags"
            :key="type.index" 
            :id="type.id"
    >
        {{ type.value }}
    </option>
</select>
<div class="row mt-2">
    <div class="col">
        <label>Gas Reading</label>
        <input type="number" name="reading[]" class="form-control">

        <label>Water Reading</label>
        <input type="text" name="reading[]" class="form-control">

        <label>Electric Reading</label>
        <input type="number" name="reading[]" class="form-control">
    </div>
    <div class="col">
        <label>Reading Date</label>
        <input type="date" class="form-control" name="reading_date[]">

        <label>Reading Date</label>
        <input type="date" class="form-control" name="reading_date[]">

        <label>Reading Date</label>
        <input type="date" class="form-control" name="reading_date[]">
    </div>
</div>

Here's what I have currently with Laravel:

$readings = $request->get('reading');   
$dates = $request->get('reading_date');
$types= $request->get('reading_type');

for($i = 0; $i < $readings; $i++){
    $reading = new MeterReadings;
    $reading->user_id       = user()->id;
    $reading->entered_by    = user()->name;
    $reading->meter_type    = $types[$i];
    $reading->property_id   = $request->property;
    $reading->reading       = $readings[$i];
    $reading->reading_date  = $dates[$i];
    $reading->save();
}

But it's not saving or throwing some errors like Undefined offset: 2

within Vue I send a post request like so:

addReading: function() {
        let readingForm = document.getElementById('readingForm');
        let formData = new FormData(readingForm);

        axios.post('/api/addReadings/', formData);
}

If I dd() the request I get the full request:

array:4 [
  "property" => "161"
  "reading_type" => array:2 [
   0 => "moved_out"
   1 => "move_in"
 ]
 "reading" => array:6 [
    0 => "001"
   1 => null
   2 => null
   3 => "002"
   4 => null
   5 => null
 ]
"reading_date" => array:6 [
  0 => "2018-12-12"
  1 => null
  2 => null
  3 => "2018-12-13"
  4 => null
  5 => null
 ]
]

Any help/advice to get these to save as individual rows would be awesome, sorry it's a lame question, just having a really bad brain freeze and it's been one of them weeks, so help greatly appreciated.

theUnforgiven left a reply on Within Foreach Loop

Figured it out by adding and ID to the form element, then added the following to the method:

let readingForm = document.getElementById('readingForm');
let formData = new FormData(readingForm);

theUnforgiven left a reply on Within Foreach Loop

I'm still hitting a wall here, looking for some advice on this, new to the updated VueJS version and not worked with it for a long time so I'm a little stuck.

13 Dec
1 month ago

theUnforgiven started a new conversation Within Foreach Loop

If there's more than 1 record returned from the axios call, it shows two of the following code:

<div class="col" v-for="tenancy in tenancies">               
                    <div class="alert alert-warning">
                        <h5>Tenancy Details</h5>
                        <ul class="list-unstyled">
                            <li>Ref No: {{ tenancy.ref_no }}</li>
                            <li>Tenant: {{ tenancy.tenant.name }}</li>
                            <li>Start Date: {{ tenancy.tenancy_start | formatDate }}</li>
                            <li>End Date: {{ tenancy.tenancy_end | formatDate }}</li>
                        </ul>
                    </div>
                    <label>Reading Type</label>
                    <select name="reading_type" class="form-control">
                        <option value="">Please Select</option>
                        <option value="move_in">Moving In Reading</option>
                        <option value="mid_term">Mid-Term Reading</option>
                        <option value="moved_out">Moving Out Reading</option>
                    </select>
                    <div class="row mt-2">
                        <div class="col">
                        <label>Gas Reading</label>
                        <input type="number" name="reading[gas]" class="form-control">
                   
                        <label>Water Reading</label>
                        <input type="text" name="reading[water]" class="form-control">
                    
                        <label>Electric Reading</label>
                        <input type="number" name="reading[electric]" class="form-control">
                    </div>
                    <div class="col">
                        <label>Reading Date</label>
                        <input type="date" class="form-control" name="reading_date[gas]">
                
                        <label>Reading Date</label>
                        <input type="date" class="form-control" name="reading_date[water]">
                    
                        <label>Reading Date</label>
                        <input type="date" class="form-control" name="reading_date[electric]">
                    </div>
                </div>

So my question is how do I get the data from each one.

theUnforgiven left a reply on Vue, OnChange, Foreach Loop, Display With New Html Elements

No that didn't work, but this does:

getReadings: function() {

            let reading = this;

            axios.get('/api/meter-reading/result/' + this.propertyId)
                .then(function (data) {
                    reading.tenancies = data.data;
                });
        },

theUnforgiven left a reply on Vue, OnChange, Foreach Loop, Display With New Html Elements

The componant is above i havent changed it only the ‘then’ fucntion on the call

theUnforgiven left a reply on Vue, OnChange, Foreach Loop, Display With New Html Elements

I see, i’ll try that, tha k you very much. ?

theUnforgiven left a reply on Vue, OnChange, Foreach Loop, Display With New Html Elements

Anyone, have any more suggestions on this please?

theUnforgiven left a reply on Vue, OnChange, Foreach Loop, Display With New Html Elements

Anyone, have any more suggestions on this please?

12 Dec
1 month ago

theUnforgiven left a reply on Vue, OnChange, Foreach Loop, Display With New Html Elements

This is what is the output is from the JSON call I make when viewing console

(2) [{…}, {…}]
0: {id: 124, ref_no: "TN09102149", property_id: 161, agency_id: null, landlord_id: 61, …}
1: {id: 125, ref_no: "TN09102150", property_id: 161, agency_id: null, landlord_id: 61, …}
length: 2
__proto__: Array(0)

theUnforgiven left a reply on Vue, OnChange, Foreach Loop, Display With New Html Elements

Yes, thought I'd tried this and I get

Uncaught (in promise) TypeError: Cannot read property 'data' of undefined

theUnforgiven left a reply on Vue, OnChange, Foreach Loop, Display With New Html Elements

Thank you, i will give that a try, although i’m pretty sure i did try that and got the same response.

theUnforgiven started a new conversation Vue, OnChange, Foreach Loop, Display With New Html Elements

Hi all,

I'm struggling a little trying to get the following to work.....

So basically I have a select which upon user selection it gets the ID of the record, which works fine. But upon this I want to loop through each record get certain bits of data and put within html elements on the same page.

Here's what I have currently:

// Vue File:

<template>
    <div>
        <select name="property" class="form-control" v-model="propertyId" @change="getReadings">
            <option value="">Please Select</option>
            <option v-for="(property, index) in properties" 
                    :value="property.id"
                    :key="property.index" 
                    :id="property.id"
            >
                {{ property.name_number }} {{ property.street }}, {{ property.town }}, {{ property.postcode }}
            </option>
        </select>
    </div>
</template>

<script>
export default {

    name: 'TenancyMeterReading',

    props: ['properties'],

    data: () => {
        return {
            propertyId: '',
            tenancies: {}
        }
    },

    methods: {
        getReadings: function() {
            axios.get('/api/meter-reading/result/' + this.propertyId)
                .then(function(response) {

                    for (let tenancy = response.data; tenancy > response.length; i++) {

                        this.tenancies = tenancy[i]
                    }
                }).catch(function(error) {
                    console.log(error.response.data);
                });
               
        },

        addReading: function() {

        }
    }

}
</script>

<style>

</style>

// Blade file
<meter-reading :properties="{{ $properties }}"></meter-reading>

Here's the Vue Tools showing:

Any help/advice greatly appreciated,

04 Dec
1 month ago

theUnforgiven left a reply on Laravel Calendar Add Event On Fly

What have you tried?

23 Nov
1 month ago

theUnforgiven left a reply on Bootstrap Typeahead Select

Ok, cool. I'll check this out. Thanks dude :)

theUnforgiven left a reply on Bootstrap Typeahead Select

Will have a look at this thanks, but surely $('#quick_search_name').val(''); would just get the value from what is typed rather than what is shown from the autocomplete?

theUnforgiven left a reply on Bootstrap Typeahead Select

Anyone else encountered this problem and how did you fix?

theUnforgiven started a new conversation Bootstrap Typeahead Select

Hi all,

I can't seem to get my code to work so when a user selects from the autocomplete it enters into the input.

Heres the code:

// JS

let path = "{{ url('search/landlord') }}";

$('#search').typeahead({
    minLength: 3,
    source:  function (query, process, ) {
        return $.get(path, { query: query }, function (data) {
            return process(data);
        });
    },
    select: function( ui, item ) {
        console.log(item); 
    }
});


// HTML

<input type="text" class="form-control" name="term" id="search" placeholder="Start typing something to search..." data-provide="typeahead" autocomplete="off">


Both console.log(item); and console.log(ui); shows as undefined... Any suggestions on whats wrong or what I may have missed.

16 Nov
2 months ago

theUnforgiven left a reply on Cloning Rows, But....

@makis - Thanks for this, I'll give this a try also.

14 Nov
2 months ago

theUnforgiven left a reply on Cloning Rows, But....

Hmm yes good point, how does one make it unique?

theUnforgiven left a reply on Cloning Rows, But....

Ok so I added this:

jQuery(document).on('change', '.tenants', function(e) {
    let tenant = $(".tenants").val();

    $.ajax({
        type: 'GET',
        url: '/api/tenant/right-to-rent/' + tenant,
        success: function (data) {
            if(data.status == 1) {
                $("#r2r").html('<div class="alert alert-success table-alert">Completed</div>');
            }
            else {
                $("#r2r").html('<div class="alert alert-danger table-alert">Incomplete</div>');
            }
        },
        error: function () {
            console.log('An error occurred.');
        }
    });
});

Which kinda works, but copies the top row and then when you select on the 3rd row it inputs the alert on row 1.

13 Nov
2 months ago

theUnforgiven left a reply on Cloning Rows, But....

I hear ya @cronix i will that a read and try it out. Thanks

theUnforgiven left a reply on Cloning Rows, But....

Yes so if i press add new row then it inserts the row fine, but then selecting another user the ajax call doesnt fire

theUnforgiven left a reply on Cloning Rows, But....

Apologies, I did forgot to post the form, so here it is.

I want the new row to have a unique ID as you say sharing the same ID won't work obviously.

Form:

<table class="table table-sm" id="tenancy-table">
                                        <thead>
                                            <tr>
                                                <th colspan="2" class="text-center">Tenant(s)</th>
                                                <th class="text-center">Lead</th>
                                                <th class="text-center">Relationship</th>
                                                <th class="text-center">Paying Rent</th>
                                                <th class="text-center">Amount</th>
                                                <th class="text-center">Paying Deposit</th>
                                                <th class="text-center">Amount</th>
                                                <th class="text-center">TAP or Non TAP</th>
                                                <th class="text-center">Right to Rent</th>
                                                <th class="text-center">R2R Checked</th>
                                                <th></th>
                                            </tr>
                                        </thead>

                                        <tbody>
                                            <tr id="clone">
                                                <td colspan="2" class="text-center">
                                                    <select name="tenants" class="form-control tenants" id="tenants" style="width: 160px;">
                                                        <option>Select Tenant</option>
                                                        @foreach($tenants as $tenant)
                                                        <option value="{{ $tenant->uuid }}">{{ $tenant->name }}</option>
                                                        @endforeach
                                                    </select>
                                                </td>
                                                <td class="text-center"><input type="checkbox" name="lead_tenant" value="1"></td>
                                                <td class="text-center">
                                                    <select name="relationship" class="form-control">
                                                        <option value="family">Family</option>
                                                        <option value="friend">Friend</option>
                                                        <option value="spouse">Spouse</option>
                                                        <option value="child">Child</option>
                                                        <option value="other">Other</option>
                                                    </select>
                                                </td>
                                                <td class="text-center">
                                                    <select name="rent_paying" style="width: 100px;" class="form-control">
                                                        <option value="">---</option>
                                                        <option value="yes">Yes</option>
                                                        <option value="no">No</option>
                                                    </select>
                                                </td>
                                                <td class="text-center">
                                                    <input type="text" name="rent_contribution" style="width: 100px;" class="form-control">
                                                </td>
                                                <td class="text-center">
                                                    <select name="deposit_paying" style="width: 100px;"class="form-control">
                                                        <option value="">---</option>
                                                        <option value="yes">Yes</option>
                                                        <option value="no">No</option>
                                                    </select>
                                                </td>
                                                <td class="text-center"><input type="text" name="deposit_contribution" style="width: 100px;" class="form-control"></td>
                                                <td class="text-center">
                                                    <select name="tap" class="form-control">
                                                        <option value="">---</option>
                                                        <option value="Accredited Tenant">Accredited</option>
                                                        <option value="Accreditation Pending">Pending</option>
                                                        <option value="Not Accredited">No Accreditation</option>
                                                    </select>
                                                </td>
                                                <td id="r2r"></td>
                                                <td>
                                                    <select name="tap_checked" class="form-control">
                                                        <option value="">---</option>
                                                        <option value="yes">Yes</option>
                                                        <option value="no">No</option>
                                                    </select>
                                                </td>
                                            </tr>
                                           
                                        </tbody>
                                    </table>

theUnforgiven left a reply on Cloning Rows, But....

Anyone have a suggestion to this please.

theUnforgiven started a new conversation Cloning Rows, But....

Hi all,

I have a form and a button of which I clone the row, however this all works fine; but I have a select to select a user. Upon selection it's sends an ajax request to get their status.

This works fine on the first row, but any additional rows it doesn't, so by the code below, how can I get this to work as I need to?

// Clone Script
$("#addRow").click(function(e) {
        e.preventDefault();
        var x = 0;
        x++;
        // Clone form-group
        var clone = $("#clone").clone();
        // Update name attribute of all input elements in the group:
        $('[name]', clone).each(function(){
            var $this = $(this);
            clone.find("input").val("");
            $("#r2r").empty();
            $this.attr('name', $this.attr('name') + '_' + x);
        });
        // Append clone to the form
        clone.appendTo($('#tenancy-table'));
        x++;
    });


// Ajax Call
$(".tenants").on('change', function() {

        let tenant = $(".tenants").val();

        $.ajax({
            type: 'GET',
            url: '/api/tenant/right-to-rent/' + tenant,
            success: function (data) {
                if(data.status == 1) {
                    $("#r2r").html('<div class="alert alert-success table-alert">Completed</div>');
                }
                else {
                    $("#r2r").html('<div class="alert alert-danger table-alert">Incomplete</div>');
                }
            },
            error: function () {
                console.log('An error occurred.');
            }
        });
    });

Thanks in advance ;)

12 Nov
2 months ago

theUnforgiven left a reply on Getting The Name Of Files In Multi Upload

Hi guys, I want to get the expiry date value also now within this array and within the form I have same as above but with an added element of:

<input id="epc-expiry" type="text" placeholder="Pick a date" class="form-control" value="{{ old('energy_expiry', $property->expiry_date) }}" name="file[energy_expiry]">

So how can I get the energy_expiry value also?

07 Nov
2 months ago

theUnforgiven left a reply on Please Bring Back The Older Laracasts Design

Stuff all the "haters" this is far the best Laracasts design I have seen and I remember the very 1st design.... A Job well done @jeffreyway ;)

theUnforgiven left a reply on What About New Look @laracast.com

Tailwind, if you look at some of the videos of the past few weeks, Jeff shows us that he's using Tailwind.

theUnforgiven left a reply on Upgraded To Mojave, Homestead Not Working

Not a solution or a answer to your question, but have you tried Laravel Valet instead?

theUnforgiven left a reply on What About New Look @laracast.com

Really well presented, nice color scheme and looks the bomb!