zymawy

zymawy

Web Developer at Alkharit

Member Since 2 Years Ago

Makkah

Experience Points
107,070
Total
Experience

2,930 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
1043
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.

Level 22
107,070 XP
Jul
20
2 months ago
Activity icon

Commented on Intro To Application Testing

Welcome

Nov
29
10 months ago
Activity icon

Replied to How To Handle Dynamic Permissions With Vue And Laravel

Handling Roles On Vue Could Be Very Tricky, This Package Might Be Helpful

https://github.com/websanova/vue-auth

Nov
25
10 months ago
Activity icon

Replied to How To Save Category In Laravel 5.7 With Vue.js

###Are You Saving It Or Retrieving It?

Activity icon

Replied to Verify Password Is The Same , And Update It .

On Your Request


//For Exmaple ValidateOldPassword

    /**
     * Configure the validator instance.
     *
     * @param  \Illuminate\Validation\Validator  $validator
     * @return void
     */
    public function withValidator($validator)
    {
        $validator->after(function ($validator) {
            if ($this->has('old_password') && !Hash::check($this->old_password, \Auth::user()->password)) {
                $validator->errors()->add('old_password', 'كلمة المرور القديمة ليست صحيحة');
            }
        });
    }
Oct
04
1 year ago
Activity icon

Replied to How To Paginate Eloquent HasMany Relation?

$category = Category::where('slug', $slug)->first();

$category->setRelation('lessons', $category->lesson()->paginate(10));

Mar
29
1 year ago
Activity icon

Replied to Best Way To Cascade Delete In A Polymorphic Relationship

You Could Listen To An Events That Laravel Provide


 protected static function boot()
    {
        parent::boot();

            // cause a delete of a poster to cascade
            // to children so they are also deleted
            static::deleting(function ($poster) {

                            $photos->photos->delete();

                        $poster->comments()->delete();
                    
            });

    }
Mar
28
1 year ago
Activity icon

Replied to Search Whith Laravel

Laracasts Well Be Good Suggestion

Activity icon

Replied to Search Whith Laravel

in Your index.blade.php your table

// Some Code Goes Here 
<div class="panel-body">
                    <div class="table-responsive">
                        <table class="poster-table table table-striped table-bordered table-hover tableable">
                            <thead>
                                <tr>
                                    <th>&#x26A1; #</th>
                                    <th>&#x1F3AD; </th>
                                    <th>&#x1F4C2;</th>
                                </tr>
                            </thead>
                            <tbody id="result">
                            </tbody>
                        </table>
                    </div>
                </div>
// Some Code Goes Here 

And Here Your Script

       <script type="text/javascript">
        $('#search').on('keyup',function){
            $value=$(this).val();
            $.ajax({
                type: 'get',
                url : '{{URL::to('search')}}',
                data : {'search':$value},
                success:function(data){
                    $('results').html(data);
                } 
            });
          }

You Need To Understand The Basic Or You Going To Have Some Issue On Your Coding

Activity icon

Replied to Search Whith Laravel

Hay @IT2704 Is There A Result? If So You Need Just To Output The Result Via Javascript Or Jquery

<tbody id="results">

</tbody>

..Some Code
    success:function(data){
            $('results').html(data);
       } 

Activity icon

Replied to Search Whith Laravel


 $search =  $request->search;
 $output = "";

 if ($request->ajax() ) {

     $metiers = Metier::where(function ($query) use ($search) {

           $query->Where('libelle_metier', 'LIKE', "%$search%")
        // If Want Search For More Than One Cals
                    ->orWhere('info', 'LIKE', "%$search%");
        })->get()->toArray();


} //End Of If Statement 

 if($metiers) {
    
        foreach ($metiers as $key => $metiers) {
             $output .= '<tr>'.
                        '<td>' . $metiers->id. '</td>'
                . '<td>'.$metiers->libelle_metier.'</td>'
                . '</tr>' ;
        
        } // End Of Foreach Statement 
    

} // End Of Second If Statement 

 return Response($output);


This Block Well Live Inside * search* Method

If Didn't Work Check Your Code

Activity icon

Replied to Search Whith Laravel

@IT2704 Try It Now I Update The Code :)

Activity icon

Replied to Search Whith Laravel


      $search =  $request->search;

        if ($request->ajax() ) {
            $metiers = Metier::where(function ($query) use ($search) {
                $query->Where('libelle_metier', 'LIKE', "%$search%")
        // If Want Search For More Than One Cals
                    ->orWhere('info', 'LIKE', "%$search%");
        })->get()->toArray();
  }
      if($metiers) {
          foreach ($metiers as $key => $metiers) {
             $output.='<tr>'.
            '<td>'.$metiers->id.'</td>'.
            '<td>'.$metiers->libelle_metier.'</td>'.
          '</tr>';
      }
}

       return Response($output);

Mar
27
1 year ago
Activity icon

Replied to How To Create A Custom Array Like Example

You Could Return It As A Collection

    $poster  = new Collection(Poster::all()->chunk(4,function ($each) {
      return $each;
    }));

The Result

Collection {#454 ▼
  #items: array:7 [▼
    0 => Collection {#461 ▼
      #items: array:4 [▼
        0 => Poster {#499 ▼
          #table: "posters"
          +timestamps: true
          #dates: array:2 [▶]
          #fillable: array:8 [▶]
          #connection: "mysql"
          #primaryKey: "id"
          #keyType: "int"
          +incrementing: true
          #with: []
          #withCount: []
          #perPage: 15
          +exists: true
          +wasRecentlyCreated: false
          #attributes: array:15 [▶]
          #original: array:15 [▶]
          #changes: []
          #casts: []
          #dateFormat: null
          #appends: []
          #dispatchesEvents: []
          #observables: []
          #relations: []
          #touches: []
          #hidden: []
          #visible: []
          #guarded: array:1 [▶]
          #forceDeleting: false
        }
        1 => Poster {#500 ▶}
        2 => Poster {#501 ▶}
        3 => Poster {#502 ▶}
      ]
    }
    1 => Collection {#458 ▼
      #items: array:4 [▼
        4 => Poster {#503 ▶}
        5 => Poster {#504 ▶}
        6 => Poster {#505 ▶}
        7 => Poster {#506 ▶}
      ]
    }
    2 => Collection {#457 ▼
      #items: array:4 [▼
        8 => Poster {#507 ▶}
        9 => Poster {#508 ▶}
        10 => Poster {#509 ▶}
        11 => Poster {#510 ▶}
      ]
    }
    3 => Collection {#468 ▼
      #items: array:4 [▼
        12 => Poster {#511 ▶}
        13 => Poster {#512 ▶}
        14 => Poster {#513 ▶}
        15 => Poster {#514 ▶}
      ]
    }
    4 => Collection {#450 ▼
      #items: array:4 [▼
        16 => Poster {#515 ▶}
        17 => Poster {#516 ▶}
        18 => Poster {#517 ▶}
        19 => Poster {#518 ▶}
      ]
    }
    5 => Collection {#455 ▼
      #items: array:4 [▼
        20 => Poster {#519 ▶}
        21 => Poster {#520 ▶}
        22 => Poster {#521 ▶}
        23 => Poster {#522 ▶}
      ]
    }
    6 => Collection {#456 ▼
      #items: array:2 [▼
        24 => Poster {#523 ▶}
        25 => Poster {#524 ▶}
      ]
    }
  ]
}
Activity icon

Replied to How To Run Php Artisan Serve In Background

I'm Windows User Too :), I'm Using Valet Windows It's Cool Try And It Well Runs Automatically

https://github.com/cretueusebiu/valet-windows

A Lot's Of Cool Thing

Mar
24
1 year ago
Activity icon

Replied to Update Laravel Project On Server

You Could Use GitHub To Upload Your Project Via SSH Protocol On Downtime Or Use Forge To Manage Your App Easily You Have A Lot Of Options

Activity icon

Replied to Image Upload And Saving In Laravel 5.6

You Could Use store Method Well Hashed The Name And Automatically Move The Image Into Storage Folder With Second Parms You Can Choose The Public Disk To Sive It Publicly

    // Now  $business_logo Has Full Name And Hashed You Just Need To Save It In Database 
// Somthing Like This storage/mohammad.hadi/almhnds//qLpunKA6SEvPgqtS7SCyUr7r5TiB91UdfsQJQlzM.jpeg
     $business_logo= $request->file('business_logo')->store(
     'your/folder/to/save/the-image', 'public'
    );

Than Just Linked

    php artisan storage:link

If You Want To Retirvate The Image

<img src="{!! asset('storage/'. $photo->path ) !!}" class="img-fluid" alt="">
Activity icon

Replied to Laravel API Response Return Double Quoted Numeric Value

You Could Use API Resources

https://laravel.com/docs/5.6/eloquent-resources

Or You Could Casts The All Attributes You Want To It To Be Numeric In Your Model


    protected $casts = [
      'https',
      'mode',
      // And So On 
    ];

Mar
21
1 year ago
Activity icon

Replied to In ProviderRepository.php Line 208: Class Not Found

You Can Search Full Path In Your Entire Project And Delete It

'DevDojo\Chatter\ChatterServiceProvider'
Activity icon

Replied to Save Value Of An Array

Firstly You Can Validate The Array


$this->validate($request, [
         'student_name.*'=>'required|max:50',
         'age.*'=>'required|integer',
    //Roles Goes Here 
 ]);

Than If You Can Use Php Way To Insert

    $input = $request->all();

        if (count($input['student_name']) > 0) {
            for ($i = 0 ; $i < count($input['student_name'])  ; $i++) {
                   $leads = new Lead();

                  $leads->student_name = $input['student_name'][$i];
                  $leads->gender =  $input['gender'][$i];
                  $leads->age = $input['age'][$i];
                  $leads->save();
            }
        }
Activity icon

Replied to Where Are You All From?

Saudi Araba, Makkah

Activity icon

Replied to How To Delete Multiple

$technicien= technicien::find($id);

// delete related   
$technicien->user()->delete();

$technicien->delete();

Or With Events

 technicien::deleting(function ($technicien) {
         $technicien->user()->delete();
});

Jan
11
1 year ago
Activity icon

Replied to Importing 50k+ Rows To Database From CSV

@pejman These Sames To Be Cool Thx

Dec
11
1 year ago
Activity icon

Replied to Input Old And Array

Think You @Pendo It's Worked I Was Thinking That May Dot Notation Would Worked But Didn't Try It

Nov
30
1 year ago
Nov
25
1 year ago
Activity icon

Replied to Get All Parent Categories In A Root Parent First Order

Cool @Braunson How I Can Learn Such Relations Like This ? That Was Really Helpful And Now For Me !

Oct
18
1 year ago
Activity icon

Replied to Laravel 5 : MethodNotAllowedHttpException

You Should Pass The ID of the cartin recored

Jul
24
2 years ago
Activity icon

Replied to Redirection In Vue Js

You Can You Use this.$router.push('/url')