theUnforgiven

Experience

243,400

44 Best Reply Awards

  • Member Since 4 Years Ago
  • 1279 Lessons Completed
  • 39 Favorites

24th May, 2018

theUnforgiven started a new conversation Cloudflare Caching Issue • 2 days ago

Hi all,

I've recently setup a new server on Forge and installed LetsEncrypt with Cloudflare as that seems to be an option now, but on my development URL when I push to git and auto deploy, I expect to see the changes straight away, but with Cloudflare this seems to be still caching for some reason.

Question is how can one achieve this?

18th May, 2018

theUnforgiven left a reply on Vue Modal Window • 1 week ago

Awesome, many thanks @BrandonSurowiec, I knew I wasn't far off...

;-)

theUnforgiven started a new conversation Vue Modal Window • 1 week ago

Hi all,

I'm using the following package - https://github.com/euvl/vue-js-modal for a Vue modal window.

But the problem I'm facing is passing the id.

So I have <a class="btn btn-info" @click="$modal.show('dispute-modal-' + id)">Dispute</a> which shows as dispute-modal-60 or whatever the id from Laravel is.

But I need to pass the ID to the name tag to pen the modal.

I have tried

<modal name="`dispute-modal-${++index}`">

But to no avail, where have I gone wrong, can any advise please. cc @jeffreyW

16th May, 2018

theUnforgiven left a reply on RocketShipIT • 1 week ago

Probably refer to the documentation if I was you.

12th May, 2018

theUnforgiven left a reply on Selected Option From DB • 2 weeks ago

I've tried :selected="status.html_name == bill.status" also but that doesn't work and ultimately this is kinda what I need, if bill.status matches status.html_name then it should show as selected.

theUnforgiven left a reply on Selected Option From DB • 2 weeks ago

"set status with the index of the array you have right now."

Not sure how you mean @bobbybouwmann :(

theUnforgiven started a new conversation Selected Option From DB • 2 weeks ago

So I have the following piece of code with is populated from the db with Laravel, but I want to check if the option is already against the ID, if it is then the select should be of that value as "selected", but I can't figure out how to do this,.


<select class="form-control" v-model="status">
            <option disabled value="">Please Select</option>
            <option v-for="(status, index) in statuses" 
                    :key="index" 
                    :value="status.html_name"
                    :name="status.html_name"
                
            >
                {{ status.name }}
            </option>
        </select>

11th May, 2018

theUnforgiven left a reply on Updating Db On Change Of Select Option • 2 weeks ago

anyone know how one can achieve this?

10th May, 2018

theUnforgiven left a reply on Updating Db On Change Of Select Option • 2 weeks ago

So, I'm still no further forward with showing the user their selection from the select, it just updates via my API endpoint, but then clears and shows an empty select.

theUnforgiven left a reply on Updating Db On Change Of Select Option • 2 weeks ago

anyone, know how I can do this?

theUnforgiven left a reply on Updating Db On Change Of Select Option • 2 weeks ago

@bobbybouwmann I could just do with showing the selected dropdown to the user as it currently shows as blank when updated. How would one achieve this?

theUnforgiven left a reply on Updating Db On Change Of Select Option • 2 weeks ago

Just for anyone else out there with this same problem I ended up doing the following on the update method:

updateStatus: function() {
                axios.post('/api/statuses/update', {
                        status: this.status
                    })
                    .then(response => this.status = response.data).catch(error => 
                    {
                        console.log(error.response);
                        this.message = error.response.data.message;
                    
                    });
                    
            }

Works a treat.

theUnforgiven left a reply on Updating Db On Change Of Select Option • 2 weeks ago

@bobbybouwmann that's it, I knew I missing something, I see that now. As for CSRF I'll just include within the VerifyCSRF file.

theUnforgiven started a new conversation Updating Db On Change Of Select Option • 2 weeks ago

Hi all,

I want to update the db upon select change with the foreach loop. Here's what code I have so far.

<template>
    <div>
        <select class="form-control" v-model="status" @change="updateStatus">
            <option v-for="(status, index) in statuses" 
                    :key="index" 
                    :value="status.html_name"
                    :name="status.html_name"
                
                
            >
                {{ status.name }}
            </option>
        </select>
    </div>
</template>

<script>

    export default {
        props: ['status'],

        data() {
            return {
                statuses: [],
                status: 'Please Select'
            }
        },

        created() {
            $.getJSON('/api/statuses', statuses => this.statuses = statuses);
        },

        methods: {
            updateStatus: function() {
                axios.post('/api/statuses/update');
            }
        }
    }
</script>

Which renders as the following markup:

So once an option as been selected I need to post the status.html_name value to update the database. Firstly am I on the right tracks and what am I missing?

11th April, 2018

theUnforgiven left a reply on Arrays Key/value Pairs ... (brain Freeze) • 1 month ago

@Cronix legend, that's it my brain today lol Thanks dude for clearing that up, works just fine now.

theUnforgiven left a reply on Arrays Key/value Pairs ... (brain Freeze) • 1 month ago

@Cronix

Here's what I have now with the new $rent->save(); within each loop.

$rent = new RentBook;
        $rent->user_id = $request->tenant;

        foreach($request->item as $key => $item) {
            $rent->item = $item;
            $rent->save();
        }

        foreach($request->values as $key => $value) {
            $rent->sum = $value;
            $rent->save();
        }
        $rent->save();

So obviously I need the save method last also for the $rent->user_id to be added.

theUnforgiven left a reply on Arrays Key/value Pairs ... (brain Freeze) • 1 month ago

Hi @Cronix , then $rent->save(); after the loop also to save other values I need to save to the same table?

theUnforgiven started a new conversation Arrays Key/value Pairs ... (brain Freeze) • 1 month ago

Hi all,

I'm having one of those days where I can't figure stuff out.

Here's a image of two arrays I need to save the values of to the database.

!()[https://imgur.com/UpHiiM0.png]

I've tried the following, but this only saves the last one, rather than how ever many is passed.

foreach($request->item as $key => $item) {
         $rent->item = $item;
}

Any help, greatly appreciated, and sorry for the dumbass question, just been one of them days.

8th February, 2018

theUnforgiven left a reply on Atom Editor • 3 months ago

Moved VSCode yesterday and it's quite good.....Bye PHPStorm (for now at least)

6th February, 2018

theUnforgiven left a reply on Search With Join • 3 months ago

anyone?

theUnforgiven left a reply on Search With Join • 3 months ago

Anyone got any suggestions

theUnforgiven left a reply on Search With Join • 3 months ago

<form action="{{ url('admin/api/search') }}" method="post">
                    {{ csrf_field() }}
                    <input type="text" name="term" class="form-control" placeholder="Search user id, username, email or purchase transaction id, then hit enter">
</form>

Is the form, just text input

theUnforgiven left a reply on Search With Join • 3 months ago

Tried that already as:

 $users = DB::table('users')
                    ->where('username', 'LIKE', '%'. $searchTerms .'%')
                    ->orWhere('email', 'LIKE', '%'. $searchTerms .'%')
                    ->join('coin_payment', function ($join) use ($searchTerms) {
                        $join->on('users.id', '=', 'coin_payment.user_id')
                             ->where('coin_payment.status', '=', 'pending');
                    })
                    ->orWhere('coin_payment.uuid', 'LIKE', '%'. $searchTerms .'%')
                    ->get();

which results in:

Undefined function: 7 ERROR: operator does not exist: uuid ~~ unknown
LINE 1: ... LIKE  or "email" LIKE  or "coin_payment"."uuid" LIKE 

theUnforgiven left a reply on Search With Join • 3 months ago

Thats the point there isn't the uuid part, as I don't know how to structure it so when a user searches (which points to this function) by uuid the code picks that up then returns the results like username and email does.

theUnforgiven left a reply on Search With Join • 3 months ago

$searchTerms is just a request from the search form, so currently it works if you search by username and email, but if you search for a UUID which is in the payment table it doesn't find it and causes an error.

So i need to know how to add this to the where clauses, so if you type in a uuid it finds it/

theUnforgiven started a new conversation Search With Join • 3 months ago

So I have the following join statement.

$users = DB::table('users')
                    ->where('username', 'LIKE', '%'. $searchTerms .'%')
                    ->orWhere('email', 'LIKE', '%'. $searchTerms .'%')
                    ->join('payment', function ($join) use ($searchTerms) {
                        $join->on('users.id', '=', 'payment.user_id')
                             ->where('payment.status', '=', 'pending');
                    })
                    ->get();

But I want it to check that if the given $searchTerms is uuid from the payment table also, like the username & email fields.

how can one achieve such task?

4th February, 2018

theUnforgiven left a reply on My Valet Install Is Messed Up {HELP} • 3 months ago

So i'm unsure why this keeps happening, after doing the above and reinstalling....Just seems weird.

theUnforgiven left a reply on My Valet Install Is Messed Up {HELP} • 3 months ago

Everything was cool earlier, but I since added a new site and went to valet secure newsite then everything stopped working

theUnforgiven left a reply on My Valet Install Is Messed Up {HELP} • 3 months ago

Using chrome and using .test

theUnforgiven left a reply on My Valet Install Is Messed Up {HELP} • 3 months ago

Again, yeah tried these steps and everything installs as expected, but then I go to valet secure my sites and then none of the sites work at all.

theUnforgiven left a reply on My Valet Install Is Messed Up {HELP} • 3 months ago

brew uninstall valet isn't valid either as Valet is installed via composer, I was referring to nginx etc that is installed by brew

theUnforgiven left a reply on My Valet Install Is Messed Up {HELP} • 3 months ago

Tried all that and reinstalled but still something not right

theUnforgiven started a new conversation My Valet Install Is Messes Up {HELP} • 3 months ago

My valet install is messed up for some reason, every time I add new sites to my code directory and go to add a new SSL cert it doesn't work.

So how can I remove everything with homebrew that is associated with Valet, so I can do a fresh install?

28th January, 2018

theUnforgiven left a reply on Valet Suddenly Stopped Working • 3 months ago

Yeah all was started and changed to .test instead, but seems every time I issue a new SSL cert for a new site, I have to then restart my machine and it works the. which is strange as it's never done this before.

theUnforgiven started a new conversation Valet Suddenly Stopped Working • 3 months ago

Hi all.

Valet has all of a sudden stopped working, so I have uninstalled, then reinstalled Valet, re-parked everything and issues new SSL certificates as per the docs, but still I get This site can’t be reachedage....

Any one else encountered this problem?

10th January, 2018

theUnforgiven left a reply on Signature Pad • 4 months ago

@Bilou, just follow these two pages through and you should be able to get yourself where you need to be.

26th December, 2017

theUnforgiven left a reply on Bootstrap Css On Production • 5 months ago

@drdan If you have used the css in the assets folder, then you will need to run npm run prod to compile it down and then reference the css as @Snapey mentions.

23rd December, 2017

theUnforgiven left a reply on Bootstrap Css On Production • 5 months ago

So whats in app.css and did you compile before deploying?

theUnforgiven left a reply on Using Cashier With A Different Table, Other Than Users (L5.4)? • 5 months ago

Just use Billable; trait on your model

theUnforgiven left a reply on Bootstrap Css On Production • 5 months ago

What errors are you seeing (if any)? If you "view source" what do you see?

16th December, 2017

theUnforgiven left a reply on Time An Article • 5 months ago

Yes, after looking around this forum, I opted for the scope approach:


public function scopeIsPublished($scope){
        return $scope->where(function($query){
            $query->where('published_at', null)
                  ->orWhere('published_at', '<', \DB::raw('NOW()')
            );
        })->orderBy('published_at', 'desc');
    }

theUnforgiven left a reply on Time An Article • 5 months ago

I'm guessing this will be queue/schedules or something, but just wanting to clarify.

theUnforgiven started a new conversation Time An Article • 5 months ago

Hi all,

Hope everyone is well and looking forward to a well deserved break....

I was wondering what the best way to have a blog post article set to a date in the future, meaning if I write a post today and want it to go live at 9am on Monday how can I achieve such task?

8th December, 2017

theUnforgiven left a reply on VirtualBox Or Parallels On Vagrant For MacOS • 5 months ago

I'm on a 13" macbook pro, use Valet everyday with PHPStorm, Chrome and Sequel Pro open all at the same time and don't have any "slow" periods at all...

4th December, 2017

theUnforgiven left a reply on Using Stripe As Two Instances.... • 5 months ago

@martinbean Yeah that's what I thought would happen, just wanted to make sure my thoughts were correct.

Thanks for clearing up :)

theUnforgiven left a reply on Using Stripe As Two Instances.... • 5 months ago

Anyone know how to deal with this? Ideally my Stripe account will be the base to take payments to use the service then I want to store users stripe keys to be able to their own stripe in order to collect payments.

theUnforgiven started a new conversation Using Stripe As Two Instances.... • 5 months ago

Hi all,

I wanting to use Stripe to charge for a SaaS app, but also allow the users who have an account by able to use Stripe also to charge their customers. Is there a valid way to achieve this? With out having conflicting stripe keys :)

21st November, 2017

theUnforgiven left a reply on Integrate Google Analytics Into Dashboard • 6 months ago

Cool, thanks @martinbean I will have a gander, see what I can make happen :)

theUnforgiven left a reply on Integrate Google Analytics Into Dashboard • 6 months ago

Ah! yeah, good point @martinbean, so I'm probably better using Socialite or something then on the click of a button to get them to authenticate their Google account right?

theUnforgiven left a reply on Integrate Google Analytics Into Dashboard • 6 months ago

Again yeah I've also seen this, and think that may be the best option. Thanks all for suggestions.

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.