reny410

reny410

Member Since 4 Years Ago

Experience Points 725
Experience Level 1

4,275 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 7
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

21 Jul
3 years ago

reny410 left a reply on Show Variable In View With Compact Function

should be {{ $userdetails['userid'] }}

reny410 left a reply on No Videos In Indonesia

@londoh I live in an apartment, the kind of ISP we use isn't really available for public house I'm afraid :/ It's called Prima Net by Centrin Online.

14 Jul
3 years ago

reny410 left a reply on No Videos In Indonesia

@jaewun it's almost always difficult lol. Singapore's an exception :D

reny410 left a reply on No Videos In Indonesia

@londoh that's weird. I'm in Indonesia and I can stream and download videos like normal. check your ISP.

11 Jul
3 years ago

reny410 left a reply on Using Auth In Service Provider To Get User Object

@MarkRedeman thank you for the very thorough answer, sir.

so, when do service providers' register and boot methods called? I would like to know the app's lifecycle :)

10 Jul
3 years ago

reny410 left a reply on Using Auth In Service Provider To Get User Object

hello everyone. I've tried using auth() helper function, it also returns null. I haven't tried that with view()->composer(), how am I supposed to get the 'user' variable in my view? @jakeharris

reny410 left a reply on Using Auth In Service Provider To Get User Object

@jakeharris

thanks for replying. No, I'm trying to follow this documentation here http://laravel.com/docs/5.1/views#sharing-data-with-all-views
below is my code:

if(Auth::check()){
    view()->share('user', Auth::user());
}

it didn't work, however, so I tried this:

dd(Auth::user)

and it returns null
the code is in the AppServiceProvider's boot method, by the way

reny410 started a new conversation Using Auth In Service Provider To Get User Object

Hello,
I'm trying to get current user because I need to use view() helper function to share User object in all my views.

It doesn't seem to work, however, when I use Auth::user() in AppServiceProvider's boot method, it always returns null.

any idea why is this happening?

05 Jul
3 years ago

reny410 started a new conversation Manual Pagination After Sorting Won't Render

I have this code

$lessons = Lesson::approved()->get();
$lessons = $lessons->sortBy(function($lesson){
return $lesson->getViewCount();
});
$lessons = $lessons->reverse();
$lessons = new Paginator($lessons, 3);
$lessons->setPath('sort');
$lessons->appends(['sort' => 'viewdesc']);

is there something wrong with my code? I couldn't use simplePaginate because I need to sort my collection using my custom function (getViewCount), so this is what I tried. However, when I click on next page button, the page url parameter changes to page 2, 3 etc, but it always show the same collection :/ (page 1)

I tried this too, btw

$lessons = Lesson::approved()->get();
            $lessons = $lessons->sortBy(function($lesson){
                return $lesson->getViewCount();
            });
            $lessons = $lessons->reverse();
            $lessons = new Paginator($lessons->slice((3*$page)-3, 6), 3);
            $lessons->setPath('sort');
            $lessons->appends(['sort' => 'viewdesc']);
```
and this time, the next and previous button won't even render. funny thing is, if I manually change the page parameter on URL, the content will change accordingly.




reny410 started a new conversation Appending URL Param For Paging And Searching

Hi guys, I have a page with paging and multiple kind of searching feature (search by categories, users, etc).
How do I make it so that whenever a user go to another page, the URL also includes the search term?
what I mean is really just from 'mysite.com/index?page=2' to 'mysite.com/search='looking'&page=2'

in other words, whenever I click on the next page button from simplePaginate, the search term is dismissed, so I can only go to page 2 without the search term right now. Any way I can do this 'the laravel way' ? :D

27 Jun
3 years ago

reny410 left a reply on Selecting Aggregates, Grouped By Name, Without Raw Query

@doanh yeah, normally I would do that. But in this case, raw query is not allowed. it's some kind of a challange thing lol

24 Jun
4 years ago

reny410 started a new conversation Selecting Aggregates, Grouped By Name, Without Raw Query

here's my current code

DB::table('users')->join('activities','users.id', '=','activities.user_id')->join('gamifications', 'activities.name', '=', 'gamifications.name')->groupBy('users.username')->sum('gamifications.point');

as you can see, I'm trying to join user table with activities and gamification table.
The activities table has what users had been doing, and gamifications table has 'how many points an action will get you'.
I'm trying to get how many points each user have, but the code above doesn't seem to work, any idea?
and btw, I may not use raw query :/

17 Jun
4 years ago

reny410 left a reply on Using Authorize Function In Request?

@mstnorris dear sir, I hereby announce you a scholar and a gentleman. thank you! :D

reny410 started a new conversation The Correct Way To Use Authorize Function In App\Http\Request Class?

Here's my situation, I created a forum where a user can edit their post. when a user does a post request to edit their post, I want to confirm if the post is actually his/hers. so I created a EditPostRequest, and pass it to the editPost function in my ForumController. However, in my authorize() function in EditPostRequest, I can't figure out how to get the user_id of that post (the ID of the post's creator). I resolved this by using session()->flash(), but I don't think this is the correct way to do this :/

is there any way I can change how EditPostRequest is created in my editPost function so that it passes the post's user_id?