Naysoewin

Member Since 10 Months Ago

Experience Points
34,130
Total
Experience

870 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
309
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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.

  • Community Pillar

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

Level 7
34,130 XP
Mar
05
1 month ago
Activity icon

Started a new Conversation Load More Instead Of Pagination

Hello everyone,

Currently, i am working on React and Laravel project , I just would like to achieve 'load more' instead of pagination ,

Actually i have pretty simple index method that implementing with spatie query builder.


 public function index()
    {
        $products = QueryBuilder::for(Product::class)
            ->allowedFilters([
                'subject',
                AllowedFilter::exact('user_id'),
            ])
            ->withCount(['viewCounts'])
            ->paginate(20);

        return (new ProductResource($products))
            ->additional([
                'message' => 'success'
            ])
            ->response()
            ->setStatusCode(Response::HTTP_OK);;
    }

public function loadMore() {
	//
}

how should i get 20 news products when i send get request from client with above query builder options

Thanks

Feb
26
1 month ago
Activity icon

Replied to Message: "CSRF Token Mismatch." , Post Request From React Axios

Hi, @tykus ,

I found one target , (Sanctum)

when i try to comment out this EnsureFrontendRequestsAreStateful::class, from Kernel.php, it works

also same, working if i comment out this 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1' from sanctum.php config

But i don't know why concerned with this

Thanks

Activity icon

Replied to Message: "CSRF Token Mismatch." , Post Request From React Axios

Hi, @tykus ,

Thanks for reply , yes i am working on all of my routes in the routes/api.php, as i mentioned earlier , it's working fine with Postman or Angular project ,

edited when i google it , most of people are getting token from meta tag as you mentioned , but i don't see token when i pass to meta content like content={{ csrf_token () }} i see only this X-CSRF-TOKEN: {{ csrf_token() }} in the request header instead of token

'X-CSRF-TOKEN': document.head.querySelector('meta[name="csrf-token"]')?.getAttribute('content'),

Thanks again

Activity icon

Started a new Conversation Message: "CSRF Token Mismatch." , Post Request From React Axios

Hello,

Could someone explain me why I am receiving message: "CSRF token mismatch." , from server when i send api post request from React project (get request ok)

It's working fine if i send request from Angular project or Postman .

Thanks

Jan
11
3 months ago
Activity icon

Replied to How To Return Multiple RouteKeyName

Hi martinbean,

Thanks for your reply, it's a great solution also , but what about if i want to implement an apiResource route ? Do I need to separate each route or any other options from your advice?

Activity icon

Replied to How To Return Multiple RouteKeyName

Hi Tray2,

Great idea, it works , but I would to understand more if you still have any other similar solution that i can defined without checking request is number or string using is_numeric function. Thanks again

Activity icon

Started a new Conversation How To Return Multiple RouteKeyName

Hello everyone,

Is it possible to return multiple route key name with array? I just want to use both slug and id


public function getRouteKeyName()
    {
        return ['slug', 'id'];
    }

Thanks

Oct
26
5 months ago
Activity icon

Replied to How To Implement Tab Param In Vue Route

Solved !!, Thanks all

Activity icon

Started a new Conversation How To Implement Tab Param In Vue Route

Hello,

I am creating SPA (Laravel + Vue ),

I just would like to know the idea or the way how to implement this small feature that i am expecting, i have done this feature on my pure Laravel blade project but i have no idea how should start on Vue (SPA)

Blade style

@empty ($tab)
@include('profiles.tabs.activities')
@else

@if (view()->exists("profiles.tabs.{$tab}"))
@include("profiles.tabs.{$tab}")
@endif
@endempty

Example : User profile will have many tab like [activities, setting and etc] , when i load user id (12) as below

localhost/users/12?tab=activities

it should render activities component , again if i load setting, it should replace with setting components without repeating others.

If possible and you could help me, please let me know how should i do or an article that i can read

Many Thanks

Oct
13
6 months ago
Activity icon

Replied to Get All Departments From Active Company

Yes , This is exactly what i am expecting, Thank you so much Sinnbeck.

Yes true it will have only one active company.

Activity icon

Replied to Get All Departments From Active Company

Hi, @sinnbeck ,

Thanks for reply, actually, i don't want to fetch via company with eager load . My goal is only want to get departments list from active company only ,

Yes i am hoping to get from one company only.

Thanks again

Activity icon

Started a new Conversation Get All Departments From Active Company

Hello,

Company Model hasMany departments


public function departments() {
        return $this->hasMany(Department::class);
    }

I just want to fetch all of depertments from active company, I think i make something wrong here , please help me check and thanks


public function index()
    {
        $company = Company::where('is_active', true)->get();
        return DepartmentResource::collection($company->departments()->get());
    }