mrbadr

mrbadr

Member Since 1 Year Ago

Experience Points 1,900
Experience Level 1

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 1
Lessons
Completed
Best Reply Awards 3
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.

04 Jun
1 year ago

mrbadr left a reply on Validate Route Where Id Is A Username

Hello, yesy you can do it, just the username should be unique after in the controller you can find user by username

01 Mar
1 year ago

mrbadr left a reply on MassAssignmentException Error On Field After Form Submission

Read this section of Laravel doc : http://laravel.com/docs/eloquent#mass-assignment

Laravel provides by default a protection against mass assignment security issues. That's why you have to manually define which fields could be "mass assigned" :

class Comment extends Model
{
        protected $fillable = ['title', 'message'];
}

mrbadr left a reply on How To Run A Function Every Time A Certain Class Is Deleted?

or you can use an observer for your Drawing Model https://laravel.com/docs/5.6/eloquent#observers

then do your unlink in deleting method

mrbadr left a reply on Validation Same Rules In Two Places

required_without:foo,bar,... The field under validation must be present and not empty only when any of the other specified fields are not present.

required_without_all:foo,bar,... The field under validation must be present and not empty only when all of the other specified fields are not present.

https://laravel.com/docs/5.6/validation

mrbadr left a reply on Validation Same Rules In Two Places

you could use required_without. which requires the field under validation to be present and not empty only when any of the other specified fields are not present. Example :

            'surname' => 'required_without:user_id|max:255',

mrbadr left a reply on Validation Same Rules In Two Places

Hello, you can place rules in your model and get them like this : $model->rules()

mrbadr left a reply on How To Change Value Of Fetched Data

by using Accessor from your model like this

/**
 * Get the status
 *
 * @param  string  $value
 * @return string
 */
public function getStatusAttribute($value)
{
    return $value ? 'available' : 'not available';
}

mrbadr left a reply on Prevent Foreach Loop From Repeating Data Twice.

ah you want dispaly product for eache size try this :

@foreach ($productProductOptions as $productProductOption) @foreach($productProductOption->product->options as $productOptions) {{ $loop->iteration }}

            <td>{{ $productProductOption->product->title }}</td>

            <td>{ {{ $productOptions->name }}</td>
    </tr>
@endforeach 

@endforeach

mrbadr left a reply on Prevent Foreach Loop From Repeating Data Twice.

Hello, can you try this solution :

@foreach ($productProductOptions as $productProductOption)
<tr>
        <td>{{ $loop->iteration }}</td>

        <td>{{ $productProductOption->product->title }}</td>

        <td>{{ $productProductOption->product->options->implode('product', ' ') }}</td>
</tr>
@endforeach 

mrbadr left a reply on Count() Method Does Not Return Actual Number Of Records When Using GroupBy() Statement.

Hello you can use count() from collection by getting the results befor count like this:

$count = \App\Children::whereIn('status', ['A','I'])
    ->groupBy('user_id')
    ->get()
    ->count();

try this and tell me

26 Feb
1 year ago

mrbadr left a reply on Problem With Sneaker Lbrary

Hello, you can use a error tracker like : Sentry => www.sentry.io or NewRelic => www.newrelic.com/ or Others.......

mrbadr left a reply on Laravel Blog User Post

you have to get user from the $post object : $post->user .....

mrbadr left a reply on Codeception Installation Error Via Composer

can you show your compoer.json ?

mrbadr left a reply on Pass Variable To Laravel Notification

yes you can do it by passing variable in constructor from your notification class ('RoomStatusReception'):

protected $notifyroomnumber;

    public function __construct($notifyroomnumber)
    {
    $this->notifyroomnumber = $notifyroomnumber;
}


public function toDatabase($notifiable)
{
        return [
            'data'=>'room number' . $this->notifyroomnumber . 'cleaned'
        ];
}

in your form controller :

$notifyroomnumber = $request->get('roomnumber');
\auth()->user()->notify(new RoomStatusReception($notifyroomnumber));

mrbadr left a reply on Can I Cancel Event Broadcasting From Within The Event Class?

i think, you can use constructor for first question !