Clement_Te

Clement_Te

Member Since 2 Years Ago

Experience Points 6,110
Experience Level 2

3,890 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 58
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.

11 Feb
1 week ago

Clement_Te started a new conversation Envoyer: Work With Base Directory / Subfolder In Repository

Hi,

I have a repository where the Laravel backend app lives in a subdirectory called server. I am trying to figure out how to tell Envoyer that the composer commands should be run in this directory or if we can even tell Envoyer to checkout this folder only? Or should I find a way to work with the hooks (new symbolic link or something)?

Thank you for your help!

24 Oct
1 year ago

Clement_Te left a reply on Passing Values Form Related Tables To Blade

Hi @Boubou

If the relationship fails, you would not be able to call ->name on it which would throw an error. Your snippet should work according to me.

Can you maybe provide us with the migrations and your dataset?

Clement_Te left a reply on Use Vuejs In Blade Template To Conditionnally Show Block

Thank you for your answer @aurawindsurfing

The form's purpose is to create/edit a user profile. The data I need to pass to the component is therefore from a Eloquent model. I obviously have to avoid Laravel Collective inside the component. But would you see this as passing props to the component (the model, the errors bag and the arrays for the dropdowns), cause that seems a bit rough.

Or would there be a way to somehow keep my template in blade surrounded by my component which would have <slot></slot> in its template. But there I would still have to set props or the data method, right?

Thank you for your help.

23 Oct
1 year ago

Clement_Te started a new conversation Use Vuejs In Blade Template To Conditionnally Show Block

Hi,

I have a Laravel app in which I'd like to introduce a bit of Vuejs to do some conditionnal templating in forms (show extra input fields depending on dropdown values, this type of stuff).

At first, I thought I could simply init a vue app and use v-model and v-if in my blade but I realize I need to specify the data() method with default values.

What would be best practices for my need if I don't want to use Vanilla or jQuery? My main concern is that my form can get quite big and I use Laravel Collective forms and handle form validations on the service-side with the errors bags.

  • Shall I create a vue component and put my whole form, or part of it inside, passing data and errors as props?
  • Shall I create a component that mainly displays a <slot></slot> and pass data as props and I should still be able to display the errors using blade?

Thank you for your advice. Good day

24 Apr
1 year ago

Clement_Te started a new conversation HasManyThrough With SUM

Hi,

I am trying to perform a request where I have the following models:

  • Orders (orders)
  • Sub-orders (consumer_orders) with a belongsTo relation with Orders
  • Products (products)
  • Sub-orders-Products with the quantity attribute (consumer_orders_products)
  • Categories (categories) with a hasMany relation with Products

I want to be able, from the Order model, to fetch all the unique products (present in the sub-orders) with the summed quantity for each.

The request I am expecting is something like:

select products.*, sum(quantity), categories.*
from products
join consumer_orders_products on consumer_orders_products.product_id=products.id
join consumer_orders on consumer_orders.id=consumer_orders_products.consumer_order_id
and consumer_orders.order_id = $this->id
join categories on categories.id=products.category_id 
group by consumer_orders_products.product_id

What would be the best way to perform this from the Order model with Eloquent?

Thank you for your help.

Kind regards,

25 Nov
2 years ago

Clement_Te left a reply on Event Doesn't Store Model While Unit Testing

After digging a little more, I realized the event is called only on the first setUp for the first test case. The set up is rightly called 3 times, once for each case, but the event only once while each test seems to be clearly tore down (database cleaned).

Anyone?

Thank you

Clement_Te left a reply on Event Doesn't Store Model While Unit Testing

Thank you for your reply. Although, I put a var_dump in this method and I can see it is already called.

Any idea? I will try by calling it manually and let you know.

Thank you

24 Nov
2 years ago

Clement_Te started a new conversation Event Doesn't Store Model While Unit Testing

Hi,

I am facing a weird behavior while writing unit tests for my app. Basically, I have a model, that when it is created (saved into the database), a function is called that create and save another model in the database as well.

I do this using the events in Laravel 5.1 : https://laravel.com/docs/5.1/eloquent#events

Although, when unit testing, I create the model in the setUp(), the method is called as the event calls it but no new data is added to the database (while the first model correctly is).

I hope I was able to explain my issue properly.

Is there anything that I would not be aware of while unit testing?

Thank you in advance for your help. Kind regards,