bunnypro

Experience

32,380

54 Best Reply Awards

  • Member Since 7 Months Ago
  • 1 Lesson Completed
  • 0 Favorites

14th September, 2017

bunnypro left a reply on How To Secure Register Endpoint Api For First Party Mobile App ? • 2 months ago

i have done it before, but its marked as not-secure method by our security tester. They claim they can get the KEY and request with it.

I think about public and private key like ssh, but i don't know how to implement it.

6th September, 2017

bunnypro left a reply on How To Secure Register Endpoint Api For First Party Mobile App ? • 2 months ago

i mean, when registering a user, the user is not registered yet, so it can't generate oauth access_token then it can't use oauth for securing the api.

what do you mean with secure-api ? is that like a access-token ?

bunnypro started a new conversation How To Secure Register Endpoint Api For First Party Mobile App ? • 2 months ago

As far as i know, OAuth 2 requires user credential for authentication. But here we don't have any user credential yet.

anyone knows how to secure it ?

28th August, 2017

27th August, 2017

bunnypro left a reply on Save Method Doesn't Work On Any Object, While Login Is Ok • 2 months ago

i see that you manually fill the Note id attribute, so i assume you're not auto increment it, so you have to set $incrementing = false in your Note model.

https://laravel.com/docs/5.4/eloquent#eloquent-model-conventions in primary keys section

bunnypro left a reply on Save Method Doesn't Work On Any Object, While Login Is Ok • 2 months ago

look inside your note/edit.blade.php, the specific Note that you're trying to get is not exists. that's what the error exception said.

bunnypro started a new conversation Anyone Experienced In Using Runcloud.io With Envoyer.io ? • 2 months ago

as far as i know, runcloud io has its own environment that i can't access directly, for example in deployment script, it has its own aliases for php-cli.

how do i implement it ?

11th July, 2017

bunnypro left a reply on Data Undefined In Child Component • 4 months ago

add v-if directive in your input

<input v-if="row.basePrices" v-model="row.basePrices.labor">

bunnypro left a reply on Get Selected Values From Database In Checkboxes (Laravel) • 4 months ago

you can pass the related divisions to the modal by set it as data-* in modal button trigger, and then set the checked checkbox with javascript.

http://getbootstrap.com/javascript/#modals-related-target

// inside $subjects foreach
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#yourEditModal" data-divisions="{{ $subject->divisions->pluck('id')->toJson() }}">Edit</button>

// do your javascript to check all related division checkbox

bunnypro left a reply on Property Or Method "test" Is Not Defined On The Instance But Referenced During Render.... • 4 months ago

@eddy1992 you should not attach Vue to body, html or any element that contains script. try create an element with an id and attach vue to it

// html
<div id="app">
    {{ test }}
</div>

// sciprt
new Vue({
    el: '#app',

    data: {
        test: 'Hello'
    }
})

6th July, 2017

bunnypro left a reply on Vue Says My Property Isn't Defined, But I Think It Is...? • 4 months ago

look in your vue dev tool, is the specified data (blah) exists ?

16th June, 2017

bunnypro left a reply on Update Data Into Table From Dynamically Created Input Field • 5 months ago

inside your iteration, i think you should do like this

Itinerary::updateOrCreate(
    ['tour_id' => $tour_id],
    [
        'plan' => $temp_itinerary[$i],
        'day' => $temp_day[$i]]
    ]
);

bunnypro left a reply on Laravel Validation: Make A Field Required If Other Fields Are Present BUT Don't Make It Required If A Certain Field Has A Specific Value • 5 months ago

may be you should use required_with_all instead. from your descripiton you can do like this

[
    'A' => 'required_with_all:B,C|required_unless:D,1'
];

bunnypro left a reply on How Do I Call A Public Function Inside Of My Controller? • 5 months ago

you should call it like this

call_user_func([$this, $data['currentTab']]);

15th June, 2017

bunnypro left a reply on Vue Form - Promises - Resetting Button Immediately • 5 months ago

if you want to call this in a closure, use es6 arrow syntax or bind this to the closure.

.catch(errors => {
    this.busy = false;
});

or

.catch(function(errors) {
    this.busy = false;
}.bind(this));

bunnypro left a reply on Vue Form - Promises - Resetting Button Immediately • 5 months ago

from your question above, i think you just miss placed the this.form.saving = false;, you should place it inside the catch call back, not as parameter.

it should be

.catch(error => {
    swal( ... );

    this.form.saving = false;
});

14th June, 2017

bunnypro left a reply on Php Variable Function • 5 months ago

how about

$this->{$request->response}($task);

bunnypro left a reply on Changing The Value Of 'this' Within A Vue Method • 5 months ago

you can bind this to the closure

function() {
    ...
}.bind(this)

12th June, 2017

bunnypro left a reply on Variable Inside The Child Component Gets Undefined? • 5 months ago

the solution is to use es6 arrow syntax or bind the this

axios.get( ... ).then(response => {
    ...
})

or

axios.get( ... ).then(function (response) {
    ...
}.bind(this))

11th June, 2017

bunnypro left a reply on Laravel , Add A New Object In Database. • 5 months ago

so the id column is an autoincrement bigint ?

try to set your table autoincrement to the last id + 1

alter table <your table name> auto_increment = <last id + 1>

bunnypro left a reply on Laravel , Add A New Object In Database. • 5 months ago

or may be the id column length is too short.

bunnypro left a reply on Laravel , Add A New Object In Database. • 5 months ago

it looks like tour id column is not autoincrement.

bunnypro left a reply on [HOW] Parent To Component: One Way Binding • 5 months ago

i think you should pass it separately, otherwise you can create mixins with above method.

bunnypro left a reply on Error "Trying To Get Property Of Non-object" With Relationship • 5 months ago

@Xanger the solution can be add a query to only get InfoGiochi that has giochi,

InfoGiochi::with('Giochi')->has('giochi')->get();

another way is add @ to ignore the error when you call it

{{ @$value->giochi->nome }}

bunnypro left a reply on Error "Trying To Get Property Of Non-object" With Relationship • 5 months ago

check on all of the collection items. (in pic you have 12 InfoGiochi items)

bunnypro left a reply on Error "Trying To Get Property Of Non-object" With Relationship • 5 months ago

may be there is InfoGiochi that doesn't have Giochi. dd() the result to make sure.

bunnypro left a reply on Column Not Found: 1054 Unknown Column 'user_user_id' In 'field List' • 5 months ago

it's your relation definition. if you don't follow the convention so you should pass the column name to your relation

// User model
public function address()
{
    return $this->hasMany(Address::class, 'user_id, 'user_id');
}

9th June, 2017

bunnypro left a reply on What Should I Do? • 5 months ago

you can register it globally

Vue.directive(name, {});

https://vuejs.org/v2/guide/custom-directive.html

bunnypro left a reply on Vue Is Not Setting Max Value Input Dynamic • 5 months ago

if you want to bind a data value to the attribute you should use v-bind: or the shorthand :

<input v-bind:value="someData" :type="someType" />

8th June, 2017

bunnypro left a reply on Problem With Relationships • 5 months ago

try this

User::with('group.projects.files')->find($id);

7th June, 2017

bunnypro left a reply on [HOW] Parent To Component: One Way Binding • 5 months ago

copy the props object

// edit-user-modal component
props: ['user'],

data: () => ({
    person: {}
}),

created() {
    this.person = Object.assign({}, this.user);
}

5th June, 2017

bunnypro left a reply on Laravel Mix Won't Run On A Fresh Install • 5 months ago

in your package.json file in scripts field, try change

cross-env NODE_ENV= ...

to

node node_modules/cross-env/bin/cross-env.js NODE_ENV= ...

bunnypro left a reply on Laravel Mix Won't Run On A Fresh Install • 5 months ago

looks like you didn't install cross-env

npm install cross-env

and change your laravel-mix version to v0.11.4, since v0.12.* has so much bug. stick with that version until v1.0 is released.

bunnypro left a reply on Component Property Not Defined When Iterating Posts • 5 months ago

looks like your v-for is reversed, it should be

<post v-for="post in posts" :post="post" :user="user"></post>

3rd June, 2017

bunnypro left a reply on I'm Looking To Change Objects Based On An Index • 5 months ago

you can use computed property

computed: {
    schema() {
        // your logic to get your dynamic schema
        // ex. return this['q_SingleTextPagePart_en_' + index]
    }
}

and then in the view

<vue-form-generator :schema="schema" :model="model" ></vue-form-generator>

2nd June, 2017

bunnypro left a reply on Call Custom Class Inside Eloquent • 5 months ago

you can define the price method as static method, so you can call it like this

Format::price( ... );

bunnypro left a reply on Serialize Array Before Insert To Database • 5 months ago

hey look at eloquent mutators array casting https://laravel.com/docs/5.4/eloquent-mutators#array-and-json-casting

you don't have to add accessor or mutator, laravel will do it for you.

bunnypro left a reply on Query String Filtering With Differnt Values From Same Column • 5 months ago

you can set your input form name as array

<input type="checkbox" name="company[]" value="1">1</input>
...

and you will get $request->get('company') as an array.

1st June, 2017

bunnypro left a reply on Simpler Nested Relationship Queries • 5 months ago

so you want accommodation from specified country ?

try this

Accomodation::whereHas('address.city.region.country', function($query) use ( $country ) {
    $query->where( 'id', $country->id );
})->get();

bunnypro left a reply on Trying To Put A Key/value In A Collection • 5 months ago

ah, i forget somthing. inside map after function() add use()

(function( ... ) use ($cities) { ... })

bunnypro left a reply on Trying To Put A Key/value In A Collection • 5 months ago

i don't really know which one is faster, but i like using collection.

bunnypro left a reply on Trying To Put A Key/value In A Collection • 5 months ago

it can be done with map your projects result.

if you are in laravel >= 5.3 you can do

$projects->map(function ($project) {
    $project->name = $cities->where('geoid', $project->city_id)->pluck('name')->first();
    return $project;
});

if you are in older version you have to make it as collection first

collect($projects)->map( ... );

otherwise you can use reference (& symbol) in your foreach

foreach($projects as &$project) {
    $project->name = '...';
}

bunnypro left a reply on Load Laravel Collection As Array In Vue Parent Data • 5 months ago

if you return a collection from your controller but you get an object, may be you have manipulate your collection, so you have to add ->values() in the end and you will get the array.

any code of your controller will help.

bunnypro left a reply on Vue Components Props Binding • 5 months ago

this line

this.words[6] = "Fish";

will never work

instead you should do this

Vue.set(this.words, 6, 'Fish');

that method works for object or array.

24th May, 2017

bunnypro left a reply on Eloquent Query WHERE (OR) • 5 months ago

you can nested your query by

->where(function ($query) {
    $query->where( ... )->orWhere( ... );
})
Edit Your Profile
Update

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