HossamAli

HossamAli

Member Since 4 Months Ago

Experience Points 290
Experience Level 1

4,710 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 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.

15 Apr
1 week ago

HossamAli left a reply on Laravel OrderBy

@BOBBYBOUWMANN - I tried that and didn't work at all too it actually got me an error and IDK why :(

HossamAli started a new conversation Laravel OrderBy

Hey Guys i'm trying to sort some clips according their artist name i have tried everything but nothing happens at all, I have tried this:

$clips = Clip::with('artist')->whereHas('artist', function($query){
    return $query->orderBy('name_' . $locale);
})->paginate($this->perPage);

and also tried it like this:

$clips = Clip::with(['artist' => function ($query) use ($locale){
    return $query->orderBy('name_' . $locale);

}])->paginate($this->perPage);

and i have the relation like this:

public function artist()
    {
        return $this->belongsTo('App\Models\Artist', 'artist_id', 'id');
    }
05 Jan
3 months ago

HossamAli left a reply on Image.onload()

@DANIYUM21 - The notValid bool is defined outside those functions and those functions are called inside a loop for more than one image and this is to validate them with javascript, the problem is that the functions ends before it detects the change of the bool inside the onload(), i made a time out after the loop to give it some time to detect if it changed or not but i don't wanna use the timeout so is there another way ?

03 Jan
3 months ago

HossamAli started a new conversation Image.onload()

I have this code but the bool inside the onload is not set except after everything finishes

(function () {
                    var width, height;
                    var _img = new Image();
                    _img.src = window.URL.createObjectURL(image);
                    _img.onload = function () {
                        width = _img.naturalWidth;
                        height = _img.naturalHeight;
                        if (width * height < 10000000) {
                            notValid = true;
                        }
                    }
                })();

is there another to get the image real width and height without the onload function or how to set the bool inside it immediately

08 Dec
4 months ago

HossamAli started a new conversation Validating Iamges

I'm using Vue to view the selected image as soon as the user selects it, but i wanna know if there is a way to validate the image like check the dimensions and size and extension before uploading them or before the request is sent to the store method to store the image

05 Dec
4 months ago

HossamAli left a reply on Form Inside Foreach

@JLRDW - I just found the error and fixed it lol xD. Thanks anyways The form was inside the loop cuz i'm viewing multiple items at a time each in a separate form

HossamAli started a new conversation Form Model

Hey guys, I'm trying to make a simple edit page but i'm displaying multiple items at a time, so i made a form inside a foreach loop, and i have 2 problems : 1- i'm trying to get the status of the photo in a radio button but its not getting the current value of it, however the same exact code working for the type. and here i the code

//my code

{{ Form::label('Status', trans('labels.status'), ['class' => 'control-label col-sm-2']) }} {{ Form::radio('status', 'active', true) }} {{ trans('labels.statuses.active') }} {{ Form::radio('status', 'inactive', false) }} {{ trans('labels.statuses.inactive') }} {{ Form::radio('status', 'featured', false) }} {{ trans('labels.statuses.featured') }}
        <hr class="input_separator">
        
        <div class="form-group">
            {{ Form::label('Type', trans('labels.type'), ['class' => 'control-label col-sm-2']) }}
            <div class="col-sm-10">
                <label class="radio-inline">
                    {{ Form::radio('type', 'photo', true) }} {{ trans('labels.photo') }}
                </label>
                <label class="radio-inline">
                    {{ Form::radio('type', 'vector', false) }} {{ trans('labels.vector') }}
                </label>
            </div>
        </div>

the second problem is that the styles and scripts are only working for the first item in the page and it is not working for the rest

HossamAli left a reply on Validating And Uploading Images

@CRONIX - Thanks, this helped me a lot. But is there any way to know the dimensions as well?

04 Dec
4 months ago

HossamAli started a new conversation Validating And Uploading Images

Can I validate the images before uploading them like checking the types and file size but before uploading or it must be uploaded then validated?