walidabou

walidabou

Member Since 1 Year Ago

Experience Points
5,410
Total
Experience

4,590 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
9
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 2
5,410 XP
Nov
24
2 months ago
Activity icon

Replied to Laravel NodeJs After DEV

Can you clarify your question a bit ?

Activity icon

Replied to Double Response On RuntimeException No Application Encryption Key

Why did you delete the APP_KEY. Laravel needs it for security reasons. Run php artisan key:generate to generate a new one.

Oct
28
3 months ago
Activity icon

Replied to Authenticate With A Third-party OAuth2 Server

The third-party service is the one who will provide you with the information how you login and how you integrate it with your app.

So you need to read the documentation of that third-party service in order to see how this service works and APIs that it offers.

For example Facebook has documentation shows you how to integrate it with your app.

Activity icon

Replied to One Route For Both Authenticated And Guest Users

Auth is a facade, so you can't do Auth()->check() or Auth()->user().

Instead, you have to make it like this: Auth::check() or Auth::user().

Or with helper you can use auth()->user().

In other words you need to use :: with facades not ->

Activity icon

Awarded Best Reply on How To Send Parameters To MapAction ?

You can:

methods: {
    ...mapActions({
      login: 'auth/fetchLogin',
    }),

   loginUser() {
       this.login(userObj);
   }
}
Activity icon

Replied to How To Send Parameters To MapAction ?

You can:

methods: {
    ...mapActions({
      login: 'auth/fetchLogin',
    }),

   loginUser() {
       this.login(userObj);
   }
}
Activity icon

Replied to How To Use With() When You Have The Relationship In A 3rd Table?

Have you tried the way in my response?

Activity icon

Awarded Best Reply on Laravel Vuejs, I Have A Status Field, That Determines If A Minister Is Published Or Not, I Want To Show Published If It Is Published Or Unpublished, It Is Not Working In My V-for Loop

Maybe this is what are you looking for:

<td>{{ minister.id }}</td>
<td>{{ minister.name }}</td>
<td>{{ minister.active ? 'Published' : 'Unpublished' }}</td>

activeMinisters computed property returns an array of object, and I don't know why you put it inside the loop:

<td>{{activeMinisters}}</td>
Oct
27
3 months ago
Activity icon

Replied to ErrorException (E_ERROR) Call To A Member Function DiffForHumans() On Null (View: C:\wamp64\www\AdBlog\resources\views\user\post.blade.php)

where is the post ? You didn't fetch the post from the database in the post method. You just return the parametre that you get from the query.

Activity icon

Replied to How To Use With() When You Have The Relationship In A 3rd Table?

You need to use "Nested relationship".

https://laravel.com/docs/6.x/eloquent-relationships#eager-loading.

Look for "Nested Eager Loading" Section

Activity icon

Replied to Laravel Vuejs, I Have A Status Field, That Determines If A Minister Is Published Or Not, I Want To Show Published If It Is Published Or Unpublished, It Is Not Working In My V-for Loop

Maybe this is what are you looking for:

<td>{{ minister.id }}</td>
<td>{{ minister.name }}</td>
<td>{{ minister.active ? 'Published' : 'Unpublished' }}</td>

activeMinisters computed property returns an array of object, and I don't know why you put it inside the loop:

<td>{{activeMinisters}}</td>
Activity icon

Replied to Addd Partial Blade View Template To All Views?

Put it in your main layout that all your views extend from. Assuming you have a "layout.blade.php" which is the main layout, and all your views are extending this layout. So you can put it within "layout.blade.php" so it will be displayed on all views.

Oct
23
3 months ago
Activity icon

Awarded Best Reply on How To Add Where In Relationship : Many To Many

Try this:

use Illuminate\Database\Eloquent\Builder;

$trainings = $trainings->whereHas('participants', function(Builder $query) use ($users_ids) {
    $query->whereIn('id', $users_ids);
});

https://laravel.com/docs/6.x/eloquent-relationships#querying-relationship-existence

Activity icon

Replied to How To Add Where In Relationship : Many To Many

Try this:

use Illuminate\Database\Eloquent\Builder;

$trainings = $trainings->whereHas('participants', function(Builder $query) use ($users_ids) {
    $query->whereIn('id', $users_ids);
});

https://laravel.com/docs/6.x/eloquent-relationships#querying-relationship-existence

Oct
17
4 months ago
Activity icon

Replied to Using If Statement In Laravel

You can try this:

<?php
$image = $news->image ? $news->image : 'default.jpeg';
$ogimg =  'https://naijaswift.com/image/' . $image
?>
Activity icon

Replied to Query Builder - How Can I Sum?

Try this on Time model:

$data = Time::select( 
                DB::raw('MONTH(start_day) as month, SEC_TO_TIME( SUM( TIME_TO_SEC( `time` ) ) ) as total_time')
            )
        ->where('user_id', $user_id)
            ->whereYear('start_day', 2019)
            ->groupBy('month')
            ->get();

I'm not sure if it will work but give it a try.

Oct
16
4 months ago
Activity icon

Replied to How To Configure Controller For Complex Search?

You can do it like this

$data = new Project;

foreach($request->all() as $column => $value) {
            
     $data = $data->where($column, $value);
}

$data = $data->get();

With that, the values that are not present in the request won't be supplied to the statement.

and you can do If conditions inside the foreach to handle some attributes to be treated in another way. Example:

$data = new Project;

foreach($request->all() as $column => $value) {

    if($column == 'departement') {
            $data = $data->whereIn($column, $value);
        }
        
    else {
             $data = $data->where($column, $value);
        }
}

$data = $data->get();

NOTE: the request attributes keys must match the table columns names in db

Oct
11
4 months ago
Activity icon

Replied to JWT Multh Auth , With Different Models ( User Model , Customer Model )

Yes of coures because you didn't tell us what was the error and the error is straightforward.

Oct
10
4 months ago
Oct
05
4 months ago
Activity icon

Replied to Help Me Cant Extends The User

Remove the User class from function parameteres.

public function show(User $id) {
    return $id;
}

Correct is:

public function show($id) {
    return $id;
}
Oct
01
4 months ago
Activity icon

Replied to Foreach Returns More Than Actual Database Records

You can dd($account_types) and see if the desired attributes are present or not.

You can find them in attributes of each item.

Or check that you spell the arribute name correctly in the <option> tag.

Activity icon

Replied to Foreach Returns More Than Actual Database Records

Is a single account has more than one account_status & account_type ?

Is it one to many relationship ?

Activity icon

Replied to Foreach Returns More Than Actual Database Records

findOrFail method returns a single instance not a collection. You can't do a foreach. So your $accounts variable actually contains only ONE account.

Sep
17
5 months ago
Activity icon

Replied to Want Get Data Or Method In Relationship .

public function somedata() not function somedata()

Activity icon

Replied to "These Credentials Do Not Match Our Records" In Laravel 5.8 Auth Login Page

Try add this:

use Illuminate\Foundation\Auth\AuthenticatesUsers;

class FormatoreLoginController extends Controller
{
    use AuthenticatesUsers;



    //Other code



    protected function guard()
        {
            return Auth::guard('formatore');
        }
}

I don't know why you deleted AuthenticatesUsers trait ? with default AuthenticatesUsers added in your controller you don't need to add custom public function login().

Sep
16
5 months ago
Activity icon

Replied to Vue V-for

Did you try my solution ?

Activity icon

Replied to Why My Post Is Not Deleting

This should be a POST request not Get request.Therefore it should be inside a form.

<form class="d-inline-block" action="{{ route('channel.destroy',$channel->id) }}" method="POST">
        @csrf
        <button type="submit" class="btn btn-danger">Delete</button>
</form>
Activity icon

Replied to Vue V-for

You can do something like this.

const carsNames = [];       //To store all cars names.
const uniqueCars = [];      // To store unique objects without duplicates.
const cars = response.data;     //The data that you get from the server.

cars.forEach(car => {

    if(!carsNames.includes(car.carMake)) {

        uniqueCars.push(car);
        carsNames.push(car.carMake);
    }
});

this.data = uniqueCars;

That's what came to my mind now. There might be a better way to do it. If I find another way I will mention it.

Sep
09
5 months ago
Activity icon

Replied to Extend Auth Logic Without Modifying Laravel Files

Simply create the method in LoginController.php

use Illuminate\Http\Request;

protected function credentials(Request $request)
{
      return $request->only($this->username(), 'password');
}

So it overrides the method inside AuthenticatesUsers trait.

Activity icon

Replied to Vue On Submit

What you want to send to the other site ? Are the data the come from your server ?

Activity icon

Replied to Difference Between Laravel Echo And Laravel Echo Server?

If you are going to use pusher you don't need laravel echo server. You just need laravel echo on the front end.

laravel echo server is a community driven Socket.IO server as Laravel does not include a Socket.IO server implementation.

Sep
08
5 months ago
Activity icon

Replied to Refresh Page Without Reloading

You need Ajax

Sep
07
5 months ago
Activity icon

Replied to Real Time Communication Using Laravel And Pusher

remove the $ sign from the event constructor.

$this->$text = $text;

to

$this->text = $text;
Activity icon

Replied to JWT AUTH , How Can I Recuparate The User Detales In The Controller

You should always send the token with every request. otherways laravel won't know who is making the request.

Activity icon

Replied to 422 (Unprocessable Entity) // CreateError.js:16 Uncaught (in Promise) Error: Request Failed With Status Code 422

It seems like you have a validation error on server side.

.then(function(error)).

replace it with:

.catch(err => console.log(err.response))

to see what is the error message that you'r getting from the server.

Aug
27
5 months ago
Activity icon

Replied to Dealing With A [( )] Response

try parse the results first with JSON.parse(results).

Activity icon

Replied to Click.prevent

as you have @submit.prevent="checkPaymentForm" You don't need e.preventDefault() inside the function.

Aug
26
5 months ago
Activity icon

Replied to Axios Dosent Redirect.

You can't do server redirects with ajax requests. you must use location.href = url on client side to redirect.

Aug
25
5 months ago
Activity icon

Replied to Refactoring An Sql Sentence To Eloquent Style

better way is to make relationships between your models and use eager loading as MINA mentioned instead of using join method frequently.

Activity icon

Replied to Vue Form Validation

You can use VeeValidate to validate theinputs inside vue component. https://baianat.github.io/vee-validate/

Activity icon

Replied to Quering Restaurants According To Particular Food

Have you defined the relationship in the Restaurant model ?

public function foods() {
    return $this->hasMany('App\Food');
}

And I correct a mistake that I made in my respond => foods not food

Aug
18
6 months ago
Activity icon

Replied to Quering Restaurants According To Particular Food

Restaurant::whereHas('foods', function($q) use($request){
$q->where('food_item', 'like', '%' . $request->attribute . '%');
}
)->get();
Activity icon

Replied to Call To Undefined Function Save()

there is a syntax error: $menu->save() not $menu>save()

Aug
17
6 months ago
Activity icon

Replied to Rendering Restaurants On Google Maps

Try using Leaflet instead of Google map as google map is no longer free as I suspect. https://leafletjs.com/

They have great documentation and there is a section explains how to put the coordinations (LONG, LAN) and render your restaurant on the map.