bunnypro

Experience

31,400

51 Best Reply Awards

  • Member Since 1 Year Ago
  • 2 Lessons Completed
  • 0 Favorites

25th January, 2018

bunnypro left a reply on VueJS Selectize Input Model Binding • 3 months ago

i don't know about selectize but if you want an array, so declare the data as array

selection: []

bunnypro left a reply on Null Value • 3 months ago

Hey @Snapey

don't do $request->get('figure') because this will only get GET route variables and not POST route variables.

as far as i know the get method comes from Symfony\Component\HttpFoundationRequest and i don't see Illuminate\Http\Request override it nor any magic __call method there, as you can see here https://github.com/symfony/http-foundation/blob/master/Request.php#L699, the get method is not only get from GET method but also from request that described as $_POST here https://github.com/symfony/http-foundation/blob/master/Request.php#L81

24th January, 2018

bunnypro left a reply on How To Store Multiple Images Filename In One Column Using Laravel • 3 months ago

just for an alternative if you still want a single column to store your images you can make a json column. the simplest way is make a textcolumn and mark the column in $casts property of your model as array, it will serialize to database as a string by json_encode it, or create attribute accessor and mutator to implement your own serialize/unserialize logic.

23rd January, 2018

bunnypro left a reply on How Do I Rebind A Singleton ? • 4 months ago

i think about that at first, but since it's a singleton i just have to makeLeague\OAuth2\Server\AuthorizationServer via container and enable my own OAuth Grant in my 'App\Providers\AppServiceProvider::boot()'

// inside boot method
$server = $this->app->make(AuthorizationServer::class);

$server->enableGrantType(new MyCustomAccessGrant(), Passport::tokensExpireIn());

22nd January, 2018

bunnypro left a reply on Simple Plugin Refusing To Work • 4 months ago

may be you can use es style import

import BooBoo from './boo-boo'

bunnypro left a reply on Header Authorization JWT • 4 months ago

you can use this package tymon/jwt-auth.

bunnypro started a new conversation How Do I Rebind A Singleton ? • 4 months ago

how do i rebind a singleton that registered by a package provider ?

In my case, i want to rebind League\OAuth2\Server\AuthorizationServer that registered by laravel/passport. Actually i just want to enable my own OAuth Grant like Laravel\Passport\Bridge\PersonalAccessGrant by laravel/passport.

May be there is a more simple way to do that instead of rebind the singleton ?

14th September, 2017

bunnypro left a reply on How To Secure Register Endpoint Api For First Party Mobile App ? • 8 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 ? • 8 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 ? • 8 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 • 8 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 • 8 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 ? • 8 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 • 10 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) • 10 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.... • 10 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...? • 10 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 • 11 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 • 11 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? • 11 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 • 11 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 • 11 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 • 11 months ago

how about

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

bunnypro left a reply on Changing The Value Of 'this' Within A Vue Method • 11 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? • 11 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. • 11 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. • 11 months ago

or may be the id column length is too short.

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

it looks like tour id column is not autoincrement.

bunnypro left a reply on [HOW] Parent To Component: One Way Binding • 11 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 • 11 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 • 11 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 • 11 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' • 11 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? • 11 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 • 11 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 • 11 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 • 11 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 • 11 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 • 11 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 • 11 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 • 11 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 • 11 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 • 11 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.

Edit Your Profile
Update

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