usaandi

usaandi

Member Since 8 Months Ago

Experience Points 4,540
Experience Level 1

460 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 36
Lessons
Completed
Best Reply Awards 1
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.

27 Apr
2 months ago

usaandi left a reply on Vue.js Implement Vue-star-rating With Laravel 5.8 Project

can you try like the example-component is written what does it do then?

26 Feb
4 months ago

usaandi left a reply on Access Axios Data In Mounted

@al Try to normalize data already inside your controller. you can easily turn your data into json inside controller. You dont need to have Vue do that for you. if you can do that behind the scene. what do you get if you console.log inside your call? console.log(response), console.log(response.data) etc

''' //Get user info fetchUserInfo() { axios.get('/user/' + this.user.id + '/info').then((response) => { console.log(response); this.userInfo = response.data;

                if (response.data.length === 0) {
                    this.displayBox = true;
                }
            })

        },

'''

30 Jan
5 months ago

usaandi left a reply on Using Model Event To Constraint CRUD Actions

But that what Policies or middlewares are for. Basically you are trying to reinvent the wheel.

you should be able to do everything you need with policy. There is great tutorial in the documents. https://laravel.com/docs/5.7/authorization#generating-policies

29 Jan
5 months ago
25 Jan
5 months ago

usaandi left a reply on Disabling 180 Days After The Current Date In Bootstrap Datepicker Library

@patwan I did something similar couple days ago. using bootstrap datepicker and i got it working

 $('#date1').datepicker({
                format: 'dd/mm/yyyy',
                minViewMode: 1,
                maxViewMode: 2,
                orientation: "bottom auto",
                autoclose: true,
            }).on('changeDate', event => {

                let minDate = new Date(event.target.value);
                $('#date2').datepicker('setStartDate', minDate);
                this.startDate = event.target.value;

            });


            $('#date2').datepicker({
                format: 'dd/mm/yyyy',
                minViewMode: 1,
                orientation: "bottom auto",
                maxViewMode: 2,
                startDate: this.startDate,
                autoclose: true,
            }).on('changeDate', event => {
                let maxDate = new Date(event.target.value);
                $('#date1').datepicker('setEndDate', maxDate);
                this.endDate = event.target.value;
            });
22 Jan
5 months ago

usaandi left a reply on Object Of Class Illuminate\Database\Eloquent\Builder Could Not Be Converted To String

@TIMESOCKS - The pluck method retrieves all of the values for a given key: pluck( [ 'id', 'name' ]) etc. But get() returns all of the values.

usaandi left a reply on Store Current(future?) Entry ID

One simple way that i've done is Turning categoryAge creation you save it into variable. like so

$categoryAge = categoryAge::create( $attributes + ['event_id' => $event->id] + [ 'user_id' => auth()->id() ]);

And now you can get created object data. like so $categoryAge->id

13 Dec
7 months ago

usaandi left a reply on Store 2 Out Of 3 Fields In The Database

make your field nullable in your DB manager?

usaandi left a reply on Vuex And Multiple :class Values

@nhayder Can you try this?

<div :class="[ 'widget.wide', 'widget.pt', 'widget.pb', 'mx-auto' ]">

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

@THEUNFORGIVEN - if you have found your answer mark it as solved.

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

@theunforgiven

axios.get('/api/meter-reading/result/' + this.propertyId)
    .then(response => {
        this.tenancies = response.data;
    }).catch(error => {
        console.log(error.response.data);
    });               

Does this work or not?

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

@theunforgiven

this within a standard function is usually determined by how it's called, not where the function was created. So this in the callback function here is not the same as this outside it:

https://stackoverflow.com/questions/40189424/uncaught-in-promise-typeerror-cannot-read-property-setstate-of-undefined

getdata(){
    axios.get('/getactions')
        .then(function (data) {
            console.log(data.data);

            this.setState({
                status:data
            })
        })
}

getdata(){
    axios.get('/getactions')
        .then(data => {                // <== Change is here
            console.log(data.data);

            this.setState({
                status:data
            })
        })
}

that is one way to solve that. Or you can create variable.

getdata(){

    let that = this;
    axios.get('/getactions')
        .then(function (data) {
            console.log(data.data);

            this.setState({
                status:data
            })
        })
}

Then you can set your that.tenacies = response.data;

usaandi left a reply on Issue In Data Variable

@sarmadindhar You can make api call in the created instance. or make method and call that method in mounted like so

export default {
        data() {
            return {
                status:null,
            }
        },
        mounted() {

        this.getData();         
        },
    methods: {
        getData( ) {
            axios.get('/check_relationship_status/1' ).
                     then((resp)=>{
                         this.status=resp.body.status;         
              });

        }
    }
       
    }

OR

    created() {

        axios.get('/check_relationship_status/1' ).
                     then((resp)=>{
                         this.status=resp.body.status;         
              });
}
12 Dec
7 months ago

usaandi left a reply on Vue.js - Props Don't Update When Input Changes

I suggest you to bind your props to variable. Like so

    export default {
        props: {
        'myProp1':{
            required:true
        },
        'myProp2':{
            required:true
        },
    },
        name: "ComponentName",
        data() {
            return {
                my1text: this.myProp1,
        my2text: this.myProp2

            }
        },
}
04 Dec
7 months ago

usaandi left a reply on How Can I Get Resource Store Route Laravel

@bhargav960143 I suggest you to xdebug your middleware. Add some breakpoints and see where/when your route turns to null

usaandi left a reply on How Can I Get Resource Store Route Laravel

@bhargav960143 can't you group your route to middleware?

like this

Route::group(['middleware' => 'App\Http\Middleware\authpermission'], function () {

    Route::resource('post', 'PostController');
});
15 Nov
8 months ago

usaandi left a reply on How To Pull User-specific Data From Database After User Login.

@LARASANDE - basically it is trying to get to auth website but it can't and it is redirecting to another page but because that page is auth it fails and redirects again.

Basically you'll have endless loop if you see what i mean.

usaandi left a reply on How To I Store Multiple Array Into Database?

wont help against your problem. But!

I saw how you used deleteInventory() function in your vue file. Just saying that is not how it suppose to be. i suggest you to use

deleteSales(index) {
       this.inventories.splice(index,1)
      }

and your button

@click="deleteInventory(index)"

Much cleaner and easier to read that what you wrote there.

14 Nov
8 months ago

usaandi left a reply on How To Pull User-specific Data From Database After User Login.

@larasande Have you set up your Database?

I guess you ran command.

php artisan make:auth

But you need to run

php artisan migrate

to migrate your DB

i suggest to read https://laravel.com/docs/5.7/authentication if you have not already done that.

13 Nov
8 months ago

usaandi left a reply on How To Pull User-specific Data From Database After User Login.

Your Controller setup

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\User
use Illuminate\Support\Facades\Auth;

class LoginController extends Controller
{
    public function volorgLogin(Request $request){
    
    //if user logins with email.
    //find the required user
    
    
    $data = $request->only('email','password');

    $user = User::where('email', $data['email'])->first();
    
    //Hash check if matches input password returns true or false
    $checkPassword = Hash::check($data['password'], $user->password);
    
    if($checkPassword){

    auth()->login($user)
        
        //here return view with your $user data
    }
    


}

    public function showVolorgLoginForm(){

    if(Auth::check(){
//If User is logged in already return to dashboard or something
        return redirect()->route('home')
    }
    return view('your View name')

    
}

    
    


 

}


10 Nov
8 months ago
08 Nov
8 months ago

usaandi left a reply on Mount Vue-Component "on Demand" And Change Bind-value On Click.

First of all i suggest you to pass props with camelCase not underscore so replace :user_id with :userId in your User Component write.

props:['userId'], data(){ return {

    clickUserId: this.userId
}

}

watch: { userId: function (val) { clickUserId = val;

        }
05 Nov
8 months ago

usaandi left a reply on Nested V-model

watcher should be able to detect prop changes

prop:['myProp'],
data(){
    return{
        newValue: this.myProp,
    },

watch: {
        myProp(value){
            this.newValue = value;
        }
    }
}

usaandi left a reply on [Vue Warn]: Avoid Mutating A Prop

did you register your data prop active?

 export default {
        props:['active'],
        name: "Component",
        data(){
            return{
                isActive: this.active,
            }

        },

        methods:{
          
        }
    }

and then use this.isActive variable

18 Oct
8 months ago

usaandi left a reply on Eloquent Relationships And Aggregates

cant you do something like that

    $article->voteSum()->get();