Full Stack web developer at Freelancer

Member Since 6 Years Ago

Algiers

Experience Points
23,150
Total
Experience

1,850 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
122
Lessons
Completed
Best Reply Awards
11
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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.

  • Community Pillar

    Earned once your experience points ranks in the top 10 of all Laracasts users.

Level 5
23,150 XP
May
12
1 day ago
Activity icon

Replied to Date Casting Is Not Functioning As Expected

Try datetime instead of date: https://laravel.com/docs/8.x/eloquent-mutators#date-casting

protected $casts = [
    'birthday' => 'datetime:d.m.Y',
];
Activity icon

Replied to Skills For 2021 SAAS Application

Do I need a CSS framework?

Probably yes, if you dont went to re-invent the wheel and choose the good approach, based component like Bootstrap, or based utility first like TailwindCss

how Bootstrap and Vue.js interact with each other? If you use Bootstrap just the CSS it works fine, but if you'll use Js component you have to load jQuery, and there is some issues using both

Before you start you have to decide if you'll make an SPA(Laravel as API, and VueJs for frontend) or just injecting vue component in Laravel

Activity icon

Replied to Testing 1 To 1 And 1 To Many Relationships With Livewire

There error is : campaign_packages.title cannot be null, so check what you send as title :)

Activity icon

Replied to Best Practice For Differentiating Input Types In @foreach

If you want to create a form builder, just save all fields in db => https://prnt.sc/12u6z5q

If you have a static fields, create a config file with your field config/fields.php:

<?php 

return [
    'users' => [
        [
            'type' => 'text',
            'name' => 'first_name',
            'label' => 'First Name',
        ],
        
        [
            'type' => 'select',
            'name' => 'gender',
            'label' => 'Gender',
            'options' => [
                '1' => 'Mr',
                '2' => 'Mm',
            ]
        ],

    ], 
];

And in your blade just loop your fields and import the blade file dynamic : @include('fields.' . $type)

Activity icon

Replied to 2 Laravel App One Login

Two apps, so use the same DB :)

May
11
2 days ago
Activity icon

Replied to Recursive View

I had the same issue(not displaying but nested categories) for that I used Laravel nested and to show the list here is the link : https://github.com/lazychaser/laravel-nestedset#building-a-tree

Activity icon

Replied to Component Laravel + Vue Show Users Online/offline

Two ways :

  1. A compete solution using socket(like socket.io, pusher...)
  2. based on middleware + time, check this tutorial : https://shouts.dev/determine-user-online-status-in-laravel
Activity icon

Replied to Grouped By And Order By

Exam::orderBy('order')->groupBy('category_id')

May
10
3 days ago
Activity icon

Replied to Memory Uses

Can you check the PHP version used on both installation

May
08
5 days ago
May
07
6 days ago
Activity icon

Replied to Order By

Model::orderByRaw(".....")

Activity icon

Replied to User Id Is Null In Notifications Table

Can dd($this->buyer->user)

May
06
1 week ago
Activity icon

Replied to Issuing Sanctum Tokens For 2 Models, Please HELP!!

if I used the same User model with different roles (management_user, mobile_user,store_user), maybe this will let the (mobile_user,store_user) log in to the admin panel?

=> just use Middleware

it would be a mess if I put all the data in 1 table.

=> They are user on one table or two table no problem, you'll resolve a duplicated email(if you use 2 tables)

or should I make relations between the User model and other models like MobileUserData and StoreUserData based on the role from the User model ??

=> For extra fields I prefer to create a new table let's name user_meta(user_id:foreignId, key:string, data:json) and you store all custom data(fields) for user not need to make migration each time you need a new field

Activity icon

Awarded Best Reply on Issuing Sanctum Tokens For 2 Models, Please HELP!!

I already had the same issue, for my case always I "Keep It Simple".

Just use User model, and add a field named role to distingue the role of user.

I had a big solution for with complicated role/permission for that I used https://github.com/spatie/laravel-permission

At the end you'll not worry about sanctum, all your users are in the same table 😉

Activity icon

Replied to MsSql

I never used msSql but may be with Touching Parent Timestamps you can solve your problem : https://laravel.com/docs/8.x/eloquent-relationships#touching-parent-timestamps

Activity icon

Replied to Vue Js & Sublime Text 3

Not sure but may be this video will help you : https://www.youtube.com/watch?v=gjE1lbaC3Do

Activity icon

Replied to Notifications In Laravel

Bcz old notifications does not have "player_id", So use {{$notification->data['player_id'] ?? ""}}

Activity icon

Replied to I'm Trying To Make A Messenger, And I Use Git Hub Project, But I Have A Error "Class 'Redis' Not Found"

You have to install redis : composer require predis/predis

And make sure that redis and redis extension for php are installed

Activity icon

Replied to Datepicker Not Displaying

There is no relation btw Laravel version and Datepicker, Laravel in Backend and Datepicker in front.

May be the problem with JS, for that screenshot the console in dev tool

Activity icon

Replied to Issuing Sanctum Tokens For 2 Models, Please HELP!!

I already had the same issue, for my case always I "Keep It Simple".

Just use User model, and add a field named role to distingue the role of user.

I had a big solution for with complicated role/permission for that I used https://github.com/spatie/laravel-permission

At the end you'll not worry about sanctum, all your users are in the same table 😉

May
04
1 week ago
Activity icon

Replied to Load Schema In Testing

I'm using SQLite + memory because it's very fast than using mysql and run migration each test, there is a better way ? Taylor said : "Personally I recommend just using a file-based SQLite database during testing if you want to use schema dumps" but how ?

Activity icon

Replied to Load Schema In Testing

Yes I'm sure

Seems like there is no way to load dump in sqlite : https://github.com/laravel/framework/issues/35162#issuecomment-725476371

Activity icon

Replied to Schema:dump Test Sqlite

I'm facing the same issue, any solution after 7 months 😅

Activity icon

Replied to Load Schema In Testing

On old app I run : php artisan schema:dump --prune a "mysql-schema.dump" was generated, I copied it in new app under schema folder, when I run : php artisan migrate from command the migration works fine

But in testing I have an error : SQLSTATE[HY000]: General error: 1 no such table: users (SQL: insert into "users" ....

Seems like RefreshDatabase trait don't load "mysql-schema.dump"

Activity icon

Started a new Conversation Load Schema In Testing

Hello,

I'm starting new Laravel app for an existing app, I dont want to create or copy old migration, so in old app I generated schema, I copied the schema to the new app.

When I run : php artisan migrate I have all old table, but in testing(using memory) it does not work.

Any solution ?

Apr
08
1 month ago
Activity icon

Started a new Conversation Algolia Scout

Hello,

I have advanced search using scout Algolia, I have posts table and custom_fields related to posts

How can I filter with custom_fields ?

Thanks

Feb
03
3 months ago
Activity icon

Commented on CLI Tooling

Thank you for fnm, I'm using nvm seems like they do the same thing, another cool tool is maildev : https://github.com/maildev/maildev, I saw you use another tool but this one is better in UI

Jan
23
3 months ago
Activity icon

Started a new Conversation Algolia With Scout Timeout

Hello,

After upgrading Laravel from 7 to 8 and Algolia I always get this error : cURL error 28: Resolving timed out after 2000 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://kqt8kemceg-dsn.algolia.net/1/indexes/prod_products/settings?getVersion=2

I'm using Laravel 8.24.0 and scout : v8.6.0

Dec
24
4 months ago
Activity icon

Commented on Setup The World

Thank you very much

Dec
23
4 months ago
Activity icon

Commented on Setup The World

I liked this serie, finally it's easy to write tests :)

By the way I liked the theme you are using, what's his name?

Or just install https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync and share the gist, like dont need to ask you each time 😅

Dec
13
5 months ago
Activity icon

Replied to Unauthenticated When Using Sanctum Token

Any solution for that ? I'm using Http facade, got the same error

Activity icon

Replied to Using Local Api(protected With Sanctum)

I'm using Sanctum, read the title :)

Dec
12
5 months ago
Activity icon

Started a new Conversation Using Local Api(protected With Sanctum)

Hello,

I want to use local API , I'm using Http with withToken after creating token for logged user, but I got error

$token = auth()->user()->createToken('api-token')->plainTextToken;

$response = Http::withToken($token)->get(url('/api/v1/user'));

I got error

array:1 [▼
  "message" => "Unauthenticated."
]
Nov
11
6 months ago
Activity icon

Replied to How To Sort Result By Algolia Column Name ?

Thank you for reply, but I did no find how to sort the result

Nov
10
6 months ago
Activity icon

Started a new Conversation How To Sort Result By Algolia Column Name ?

Hello,

I'm using Laravel scout, I want to sort result by column name, how to perform that ?

Thanks