klik

klik

Member Since 2 Years Ago

Experience Points
580
Total
Experience

4,420 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
1
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.

Level 1
580 XP
Mar
30
3 months ago
Activity icon

Replied to Array Paremters In WHERE IN Condition

Sorry, my mistake. It is without colon.

Activity icon

Replied to Array Paremters In WHERE IN Condition

That's right. but I don't know maybe next week i will need to write another query with two parameters with colon.

Activity icon

Replied to Array Paremters In WHERE IN Condition

        $raw = DB::SELECT("
              SELECT p.*,
       (CASE
            WHEN EXISTS(
                    SELECT id
                    FROM user_favorites uf
                    WHERE uf.place_id = p.id
                      AND uf.user_id = :userId
                      AND uf.deleted_at IS NULL
                )
            THEN true
            ELSE false
           END ) AS favorite
        FROM (
            SELECT
                  DISTINCT ON (urv.object_id)
                  urv.id as recent_id,
                  p.id,
                  p.name,
                  p.address,
                  p.pictures
              FROM user_recent_visits urv
                       JOIN places p on urv.object_id = p.id
              WHERE urv.user_id = :userId
                AND urv.object_type = :type
                AND p.deleted_at IS NULL
                AND p.status = 2
                AND p.active = true
                AND p.id NOT IN :placesId
             ) AS p
        ORDER BY p.recent_id LIMIT 5

            ",[
            'userId' => $userId,
            'placesId' => [1,2,3],
            'type' => UserRecentVisits::OBJECT_TYPE_PLACE
        ]);
Activity icon

Replied to Array Paremters In WHERE IN Condition

What i I have another two params like "WHERE p.id IN ($condition) AND p.owner_id = :id AND p.status = :status"?

Activity icon

Replied to Array Paremters In WHERE IN Condition

As I wrote before. I can't use Eloquent my query is much more complicated. It's only example. I need to use raw sql query.

Activity icon

Replied to Array Paremters In WHERE IN Condition

Can you show me how to use in query that example with str_replace?. Always I have error "invalid parameters" or incorrect sql.

Thank you

BTW is it a bug in laravel. It looks like big bug. Why RAW sql doesn't accept array as parameter? It's part of basic sql queries.

Mar
29
3 months ago
Activity icon

Replied to Array Paremters In WHERE IN Condition

Both versions not working. Now I have error: "SQLSTATE[HY093]: Invalid parameter number: parameter was not defined (SQL: SELECT * FROM places p WHERE p.id IN :placesId )"

Activity icon

Replied to Array Paremters In WHERE IN Condition

My query is only example. It's not a real query that I need. My question is how to pass paremters as array to IN condition.

Activity icon

Started a new Conversation Array Paremters In WHERE IN Condition

Hi. I'm very surprise my code bellow doesn't work .

$raw = DB::SELECT("

            SELECT
               *
              FROM places p
              WHERE p.id IN :placesId
            ",[

            'placesId' => [1,2,3],

        ]);

I receive this error:

"Array to string conversion (SQL: SELECT * FROM places p WHERE p.id IN :placesId )"

Why it doesn't work. Most of time I use Symfony and there this query always was working so ho to write it in Laravel?

If placesId is a array and IN expect array so what is wrong?

Regards

Mar
12
4 months ago
Activity icon

Replied to Question Mark In Raw Sql Query Cause Problem

Works fine. Thank you.

Mar
09
4 months ago
Activity icon

Started a new Conversation Question Mark In Raw Sql Query Cause Problem

Hi. I have a problem in my raw query select. Example query:

DB::select( DB::raw( 
"SELECT * FROM event e WHERE e.repeat_every->'daysInWeekRepeat' ? :dayNow" 
),
 ['dayNow' => 'mon' ]
);

(Original query is much more complicate this is only example.)

Column "repeat_every" is a jsonb column, and I have to use question mark to search param value in array. This question mark cause a problem "invalid paremeter number". In output insted of question mark I get first param passed to query.

SO how to write this query to ignore question mark as a placeholder?

Thank you.