zymawy

zymawy

Member Since 1 Year Ago

Makkah

Web Developer at Alkharit

Experience Points 106,960
Experience Level 22

3,040 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 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.

29 Nov
5 months ago

zymawy left a reply on 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

25 Nov
6 months ago

zymawy left a reply on How To Save Category In Laravel 5.7 With Vue.js

###Are You Saving It Or Retrieving It?

zymawy left a reply on 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', 'كلمة المرور القديمة ليست صحيحة');
            }
        });
    }
04 Oct
7 months ago

zymawy left a reply on How To Paginate Eloquent HasMany Relation?

php $category = Category::where('slug', $slug)->first(); $category->setRelation('lessons', $category->lesson()->paginate(10));

29 Mar
1 year ago

zymawy left a reply on Best Way To Cascade Delete In A Polymorphic Relationship

You Could Listen To An Events That Laravek 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) {
                    
                    $poster->photos()->withTrashed()->get()
                        ->each(function ($photos) {

                            $photos->delete();

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

    }
28 Mar
1 year ago

zymawy left a reply on Search Whith Laravel

Laracasts Well Be Good Suggestion

zymawy left a reply on 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

zymawy left a reply on 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);
       } 

zymawy left a reply on 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

zymawy left a reply on Search Whith Laravel

@IT2704 Try It Now I Update The Code :)

zymawy left a reply on 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);

27 Mar
1 year ago

zymawy left a reply on 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 ▶}
        1 => Poster {#500 ▶}
        2 => Poster {#501 ▶}
        3 => Poster {#502 ▶}
      ]
    }
    1 => Collection {#458 ▶}
    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 ▶}
      ]
    }
  ]
}

zymawy left a reply on 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

24 Mar
1 year ago

zymawy left a reply on 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

zymawy left a reply on 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 
     $business_logo= $request->file('business_logo')->store(
      $poster->user->nickname . '/' . str_slug($poster->poster_title, '-', 'ar') . '/',
      '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="">

zymawy left a reply on 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


    protected $casts = [
        'https',
    'mode',

    // And So On 
    ];

21 Mar
1 year ago

zymawy left a reply on In ProviderRepository.php Line 208: Class Not Found

You Can The Full Path On Your Entire Project And Delete It

'DevDojo\Chatter\ChatterServiceProvider'

zymawy left a reply on 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();
            }
        }

zymawy left a reply on Where Are You All From?

Saudi Araba, Makkah

zymawy left a reply on 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(); });

`

11 Jan
1 year ago

zymawy left a reply on Importing 50k+ Rows To Database From CSV

@pejman These Sames To Be Cool Thx

11 Dec
1 year ago

zymawy left a reply on Input Old And Array

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

30 Nov
1 year ago
25 Nov
1 year ago

zymawy left a reply on 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 !

18 Oct
1 year ago

zymawy left a reply on Laravel 5 : MethodNotAllowedHttpException

You Should Pass The ID of the cartin recored

24 Jul
1 year ago

zymawy left a reply on Redirection In Vue Js

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