lakazai

Member Since 3 Months Ago

Experience Points
270
Total
Experience

4,730 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
0
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 1
270 XP
Mar
01
2 months ago
Activity icon

Replied to Count Column In Hasmany

Illuminate\Database\QueryException SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'fctwoppv.post_views.views' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (SQL: select posts.*, SUM(post_views.views) as views from posts inner join post_views on posts.id = post_views.post_id where date(post_views.date) >= 2021-02-22 group by posts.id order by post_views.views desc limit 1)

Activity icon

Replied to Count Column In Hasmany

thanks for reply

I want to calculate the total view of 7 days before then order by

Activity icon

Started a new Conversation Count Column In Hasmany

i have 2 table

posts: column id....

post_view: column id, post_id,date,views

post_view table statistics views by date

i want query get the most viewed post in the most recent week

Post::with(['postView' => function ($q) {
            $q->whereDate('date', '>=', Carbon::now()->subDays(7)->format('Y-m-d'));
        }])
       //  ->orderByDesc('views') <- how to order by with total views in recent week
            ->first();
Feb
17
2 months ago
Activity icon

Replied to FTP Move Folder In Another Server To Another Server

because move folder in another server to another server. then

shell_exec('ssh [email protected] rsync OPTION SourceDirectory_or_filePath [email protected]:Target')

It will be complicated if the number of files is large.

Activity icon

Replied to FTP Move Folder In Another Server To Another Server

thanks for reply if use use ssh/scp/rsync, how it works (i want control with laravel command + schedule)

Activity icon

Started a new Conversation FTP Move Folder In Another Server To Another Server

I have 3 server:

main server: laravel8, ubuntu 18.04, php7.4.
another server A: ubuntu 18.04, FTP server installed
another server B: ubuntu 18.04, FTP server installed

i want make command laravel (main server)

  • move folder from server A to server B
  • delete that folder in server A after move complete

Thanks!

Feb
01
3 months ago
Activity icon

Replied to Better Manage Data Passed In Ajax By Modal Post

you should learn about Eloquent: Relationships in laravel

Activity icon

Replied to Query Optimize Laravel (inRandomOrder, WhereHas, Search)

in this particular problem. Can you say more details. thank you

Jan
31
3 months ago
Activity icon

Started a new Conversation Query Optimize Laravel (inRandomOrder, WhereHas, Search)

because my data is getting bigger. I have 3 queries that I want to optimize. the posts table currently has nearly 1 million rows. I use redis so I don't talk about query cache problem.

project info: laravel 8.x, mysql5.7, php7.4.x

1.I want to get 8 post related (by category) order random in post detail page.

index: posts.status, post_category.post_id, post_category.category_id unique: posts.slug,

$post = Post::where('status', Post::PUBLISHED)->where('slug', $slug)->with(['categories', 'tags'])->first();
if (!$post) {
    abort(404);
}
$cat_ids = $post->categories->pluck('id')->toArray();
$post_related = Post::where('status', Post::PUBLISHED)
    ->whereHas('categories', function ($q) use ($cat_ids) {
        $q->whereIn('categories.id', $cat_ids);
    })->inRandomOrder($post->id)->take(8)->get();

2.This is the category detail page.

index: posts.status, posts.count_views, post_category.post_id, post_category.category_id unique: posts.slug, categories.key

public function categoryDetail($key){
    $category = Category::where('key', $key)->first();
    if (!$category) {
        abort(404);
    }
    $post_category = Post::where('status', Post::PUBLISHED)
        ->whereHas('categories', function ($q) use ($key) {
            $q->where('key', $key);
        })->orderByDesc('count_views')->paginate(24);
    return ...
}

3.This is the search page. index: posts.status

public function search(Request $request)
{
    $type = $request->input('type');
    $search = $request->input('search');

    $data['posts'] = Post::where('status', Post::PUBLISHED)->where('title', 'like', "%$search%")->paginate(24);

    return view('home.search', $data);
}

thank you