AndySong

Experience

31,040

0 Best Reply Awards

  • Member Since 6 Months Ago
  • 306 Lessons Completed
  • 0 Favorites

18th October, 2017

AndySong started a new conversation How Can I Use VUE Component To Highlight Nav Item, If I Selected?(not Tab) • 1 day ago

Hi Guys,

I am wondering, How can I use Vue component to highlight the nav item, if I select it? (not tab,different url)

will Vue work? cause apparently every time I click a new url, page get refreshed, so I am so confused how can I achieve that feature.

5th September, 2017

AndySong left a reply on How To Create More

Use Button • 1 month ago

still not clear

AndySong left a reply on How To Create More

Use Button • 1 month ago

@topvillas how to use an array of panels?

AndySong left a reply on How To Create More

Use Button • 1 month ago

can we use vue way to do it?

AndySong left a reply on How To Create More

Use Button • 1 month ago

sorry I mean create another div class="panel"

AndySong started a new conversation How To Create More

Use Button • 1 month ago

Hi all

<div class="panel" v-for="post in posts" v-cloak>
                    <div class="panel-heading">
                        @{{post.title}}
                    </div>
                    <div class="panel-body">
                        @{{post.body}}
                    </div>
                </div>
                <button @click="loadmore" class="bg-info">load more</button>

How can I create another which is class="panel" by click the load more button

AndySong started a new conversation How Can I Use Vue Data In Php File • 1 month ago

lets say I have some data in Vue and I want to access it in php files for example routes/web.php

how can I do that

pls

AndySong left a reply on Axios Response Return The Whole Html Rather Than Data • 1 month ago

@MaverickChan yes it return all the data. any idea why?

AndySong left a reply on Axios Response Return The Whole Html Rather Than Data • 1 month ago

and that is my controller

 public function index()
    {
        $posts=Post::all();
        return view('posts.index',compact('posts'));
    }

and

Route::resource('/posts','PostController');

AndySong started a new conversation Axios Response Return The Whole Html Rather Than Data • 1 month ago

Hi I am new to axios and http request, I am trying to have a get request as below

        axios.get('/posts').then(response => console.log(response));

and I have a collection of posts, but on the console I am just getting the whole html. any idea about that?

16th June, 2017

AndySong started a new conversation How Can I Return Boolean From Sql Result • 4 months ago

course_user is a pivot table, How can I know if there is a result that match the condition.

\DB::table('course_user')->where([
            ['course_id', '=', $course->id],
            ['user_id', '=', auth()->id()],
        ])

I mean how can I return it as true or false ! Thanks

AndySong started a new conversation Property * Does Not Exist On This Collection Instance • 4 months ago

I am tying to get course info from users by using a pivot table and the relationship is fine, when I did this

public function show(User $user)
    {
        return $user->courses;
    }

it shows [ { "id": 1, "course_id": "90c44fcb-e1b7-33da-9261-0ed5b42c03fe", "course_name": "Wava Oberbrunner", "created_at": "2017-06-16 07:31:06", "updated_at": "2017-06-16 07:31:06", "pivot": { "user_id": "1", "course_id": "1" } } ]

when I did this

    {
        return $user->courses->course_name;

    }

it shows Property [course_name] does not exist on this collection instance.

can anyone tell what is the easiest way to get the course_name ?Pls!

13th June, 2017

AndySong left a reply on Cannot Stream Laracast Videos • 4 months ago

all good for me too, maybe bad network?

12th June, 2017

AndySong left a reply on What Impacts I Can Get If I Do Not Write Return In A Function • 4 months ago

@mikevrind Thanks a lot for explaining me this simple question, I got it!!!

AndySong started a new conversation What Impacts I Can Get If I Do Not Write Return In A Function • 4 months ago

Hi I am new to programming, I am just wondering why that in Laravel in some functions I can get the same result whether I write "return" or not, like:

public function store ($channelId, Thread $thread) { return $thread->subscribe(); }

I can get the same result if I remove the "return".

can you guys tell me do I have to write return or it does not really matter?

cheers Andy

31st May, 2017

AndySong left a reply on Where Are You All From? • 4 months ago

any one from china???

Edit Your Profile
Update

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