bestmomo

Member Since 6 Years Ago

Toulouse, France

Experience Points
368,980
Total
Experience

0 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
20
Lessons
Completed
Best Reply Awards
418
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 50
368,980 XP
May
02
1 week ago
Activity icon

Replied to How To Add Multiple Image Upload?

Hello,

I made a serie about creating a blog on my site. It's french language but code is universel ;) I show how to use CKeditor and LFM.

Apr
06
1 month ago
Activity icon

Replied to Get Count Of <p> Tag In Text

Hello,

If you are with Blade, so server side, just set right loops. Maybe show us some code to understand your question.

Mar
31
1 month ago
Activity icon

Replied to How To Escape Character In HTML

Maybe you should use htmlspecialchars method.

Activity icon

Replied to Laravel 8 Eloquent Relationship Error

Hi,

There is no foreign key for user in your purchases table.

Activity icon

Replied to How To Escape Character In HTML

You can use double quotes inside simple quotes, so use simple quotes for your attribute value.

alt='{{ $value->getCustomProperty('alt') }}'

You also can use &quot;

Mar
30
1 month ago
Activity icon

Awarded Best Reply on Property Does Not Exist On This Collection Instance, While Using Mailable..

Try :

new MonitoringMail($dataformail);
Activity icon

Replied to Property Does Not Exist On This Collection Instance, While Using Mailable..

Maybe nothing but there is a space in your code before dataformail :

$this-> dataformail = $dataformail;
Feb
14
2 months ago
Activity icon

Replied to How To Shift Laravel Project Is In V5.8 To V7.x Or V8.x?

I made some upgrades and found easier to start with a fresh Laravel and transfer files with some adaptations.

Feb
13
3 months ago
Activity icon

Replied to Implement A Star Rating System In Laravel

I showed how to do that for a photo album project there. Whole project is there.

Jan
12
4 months ago
Activity icon

Awarded Best Reply on Frequent 504 Gateway Time-out

There are two main reasons for this error :

  • proxy : if the project is developing rapidly in a relatively short time and the number of visitors is increasing rapidly, but the proxy no longer has the necessary resources to process all HTTP requests. It is also possible that bad configurations could be the cause of the failure to process customer requests
  • application : too long and exceeded HTTP processing time can also be caused by a faulty database systems or other applications that are not functioning normally.
Activity icon

Replied to Collections 'remove' Method ?

Hello,

Try that :

$unique = $col1->unique();
$result = $col1->diffKeys($unique)->concat($unique->diff($col2));
Activity icon

Replied to Frequent 504 Gateway Time-out

There are two main reasons for this error :

  • proxy : if the project is developing rapidly in a relatively short time and the number of visitors is increasing rapidly, but the proxy no longer has the necessary resources to process all HTTP requests. It is also possible that bad configurations could be the cause of the failure to process customer requests
  • application : too long and exceeded HTTP processing time can also be caused by a faulty database systems or other applications that are not functioning normally.
Activity icon

Replied to Composer Install On Production Server

Hello,

I don't understand why run command in /www, don't you use a console in SSH ?

Jan
09
4 months ago
Activity icon

Awarded Best Reply on [SOLVED] Where Are The Route Names?

Maybe there are some resource routes in your web.php. Like this :

Route::resource('users', UserController::class);
Activity icon

Replied to [SOLVED] Where Are The Route Names?

Maybe there are some resource routes in your web.php. Like this :

Route::resource('users', UserController::class);
Jan
07
4 months ago
Activity icon

Replied to Pass An Additional Param In Anchor Href Tag

Why don't you use helpers like url or route ?

Jan
01
4 months ago
Activity icon

Replied to Workflow

In complement take care to have the same PHP version on both sides and maybe Composer version.

Dec
30
4 months ago
Activity icon

Awarded Best Reply on What Is The Proper Way To Have A BelongsToMany / HasOne Field

Looks like you need a hasMany and belongsTo relations.

Dec
27
4 months ago
Activity icon

Replied to Javascript : How To Get All Charachters Used In A String ?

You can use [...str] with ES6.

Dec
25
4 months ago
Activity icon

Replied to What Is The Proper Way To Have A BelongsToMany / HasOne Field

Looks like you need a hasMany and belongsTo relations.

Activity icon

Replied to Upload Multiple Images Laravel & Dropzone

Try with $request->file('file')

I have this working code in one of my projects :

public function store(Request $request)
{
    $photos = $request->file('file');

    if (!is_array($photos)) {
        $photos = [$photos];
    }

    if (!is_dir($this->photos_path)) {
        mkdir($this->photos_path);
    }

    if (!is_dir($this->thumbs_path)) {
        mkdir($this->thumbs_path);
    }

    for ($i = 0; $i < count($photos); $i++) {
        $photo = $photos[$i];
        $name = str_random(30);
        $save_name = $name . '.' . $photo->getClientOriginalExtension();

        Image::make($photo)
            ->resize(150, null, function ($constraints) {
                $constraints->aspectRatio();
            })
            ->save($this->thumbs_path . '/' . $save_name);

        $photo->move($this->photos_path, $save_name);

        $upload = new Upload();
        $upload->filename = $save_name;
        $upload->original_name = basename($photo->getClientOriginalName());
        $upload->index = $request->session()->get('index');
        $upload->ad_id = 0;
        $upload->save();
    }
}
Activity icon

Replied to Upload Multiple Images Laravel & Dropzone

Before your loop.

$imageNameArr = [];
foreach ($request->file as $file) {
Activity icon

Replied to Upload Multiple Images Laravel & Dropzone

No the problem is a scope issue, define your variable before :

$imageNameArr = [];
Activity icon

Replied to Upload Multiple Images Laravel & Dropzone

There is a scope issue with your variable $imageNameArr.

Activity icon

Replied to Upload Multiple Images Laravel & Dropzone

What is this line 26 ?

Activity icon

Replied to Upload Multiple Images Laravel & Dropzone

You have your error :

Undefined variable: imageNameArr

On line 26 of your controller

Activity icon

Replied to Upload Multiple Images Laravel & Dropzone

Look at error detail in browser network tab (you get it with F12)

Activity icon

Replied to Upload Multiple Images Laravel & Dropzone

I think you must change this line :

$request->file->move(public_path('path/image/'), $imageName);

for this one :

$file->move(public_path('path/image/'), $imageName);
Dec
20
4 months ago
Activity icon

Replied to Disable Validation On Get Request

Why don't you use distinct function for distinct methods ?

Activity icon

Replied to How To Seed Db In Pivot Table Laravel?

You also can use compact syntax like this kind (10 categories and 10 products for each one) :

 factory(Category::class, 10)
          ->create()
          ->each(function ($category) {
              $category->products()->createMany(
                  factory(Product::class, 10)->make();
              );
        });
Activity icon

Replied to Have I To Use Some Wrapper For Javascript Blocks In Laravel Blade ?

Blade is just HTML with special syntax, so for Javascript just use casual script tag.

Activity icon

Replied to Laravel Fortify And Paper CSS

I've had a look to breeze but I really don't like Tailwind.

On another hand I wonder why now these packages (laravel/ui and breeze) don't use Fortify.

Dec
19
4 months ago
Activity icon

Replied to How To Customize The Forgot Password Email?

Do you want to change only the text or also the template ?

Activity icon

Started a new Conversation Laravel Fortify And Paper CSS

For information I published a Github repository as Laravel 8 starting project with Fortify and Paper CSS as frontend framework.

There are all Fortify features and I added account delete.

Language default is french, just change in config.app to reverse to english.

This is the code for a french article.

Dec
12
5 months ago
Activity icon

Replied to Up-to-date List Of Blade Directives?

There is a good Cheat Sheet there but not sure is up to date.

Dec
08
5 months ago
Activity icon

Replied to Eloquent Empty Array Return. But 01 Item Is There

In Ajax mode just return the value and read it with browser tools.

Activity icon

Replied to Eloquent Empty Array Return. But 01 Item Is There

If you have a relation and the good foreign key use rather this code :

$courses = User::findOrFail($userId)->courses;
Nov
25
5 months ago
Activity icon

Awarded Best Reply on Migrate From Default Auth Scaffolding To Fortify

There is no view with Fortify so you must keep your views, but change the routes in forms, and also register your views in FortifyServiceProvider.

Remove routes and controllers because Fortify already has.

But why change ?

Activity icon

Replied to Migrate From Default Auth Scaffolding To Fortify

There is no view with Fortify so you must keep your views, but change the routes in forms, and also register your views in FortifyServiceProvider.

Remove routes and controllers because Fortify already has.

But why change ?

Activity icon

Replied to Foreign Key In Laravel 8

Yes I see but method index is useless in this code.

Activity icon

Replied to Foreign Key In Laravel 8

The correct syntax is :

$table->foreignId('user_id')
      ->constrained()
      ->onDelete('cascade');

And explications from documentation :

The foreignId method is an alias for unsignedBigInteger while the constrained method will use convention to determine the table and column name being referenced.

Nov
23
5 months ago
Activity icon

Replied to Jetstream

Seriously what in the World is wrong with regular plain CSS for a starting point.

What is wrong is only the fact that CSS is not that easy to master and it is much easier and faster to use a framework.

We could have the same reasoning with Javascript or PHP framework. Twenty years ago I was coding with simple PHP, vanilla Javascript, and CSS was still pretty mysterious.

Now things have changed a lot and technology is evolving at high speed and it seems that we often have to run to catch up with it.

Personally, I abandoned all JavaScript frameworks because browser APIs are quite sufficient.

I find it more difficult to do without a CSS framework but I have difficulty choosing and I never use the same one. On the other hand I often have a lot of CSS added to enhance the visual. I think in a year I will also give up CSS frameworks.

On the other hand I will keep Laravel for a long time!

Nov
22
5 months ago
Activity icon

Replied to Jetstream

There are three approaches:

  • use Jetstream (if you like Tailwind and Livewire)
  • use laravel / ui (if you want something simple)
  • use Fortify and create your views (but you can also get those from laravel / ui to start)