Bromira

Bromira

Member Since 2 Months Ago

Experience Points
1,900
Total
Experience

3,100 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
18
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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
1,900 XP
Nov
08
1 week ago
Activity icon

Started a new Conversation Absence Table With Individual Records For Each Day (CRUD)

First of all, thanks for any help/advice in advance.

I'm trying to track sickness and absence; normally id just have a simple table with something along the lines of:

uid | user_id | absence_start | absence_end | reason

but I'd like to be able to split to add comments for individual dates when the user checks in with us, so far I've come up with:

  1. Take a start datetime / end datetime and write a quick function to split them into individual rows - I'm worried this would be hard to maintain when editing an instance of absence (ie. if I reported someone as absent for 5 days then modified to 3 how would I keep the database consistent?).
  2. Having a table for sickness as above and a secondary linked table for comments / actions.

Could someone help point me in the right direction re. best practice in these cases?

Oct
07
1 month ago
Activity icon

Started a new Conversation Laratrust - List Members Of Team

Hi,

My question is specific to Laratrust in this instance but would be handy to know generally.

In Laratrust we have the following tables:

Permissions

  • id
  • name
  • display_name
  • description
  • created at
  • updated at

Roles

  • id
  • name
  • display_name
  • description
  • created at
  • updated at

role_user

  • role_id
  • user_id
  • user_type (Model - App\User in my case)
  • team_id

Permission_role

  • permission_id
  • role_id

Teams

  • id
  • name
  • display_name
  • description
  • created at
  • updated at

Users

  • id
  • username
  • email
  • password
  • created at
  • updated at

Users can be assigned to multiple teams at different levels (ie. User 1 could be in Team 1 as an Admin and Team 2 as a user and User 2, 3 & 4 could be a mixture of User/Admin/Editor of a mixture of different roles within the teams) admins already have the right to view and edit "users" within teams that they're admin of.

I was wondering if there is an efficient way to list the Users that are in each team the current Auth user is assigned to as Admin (including duplicate users across teams - ie. User 1 listed in Team 1 & Team 2 if they have been assigned to both)?

In straight PHP/MYSQL I would probably select all the records from role_user where the user_id = current user & role_id matched the role id for Admin then join the table on itself with Team_id and additionally join the Users table on user_id.

Is there a better way in Eloquent or an efficient way to write the same query in Laravel?

Thank you!