bestmomo

bestmomo

Member Since 5 Years Ago

Toulouse, France

Experience Points
363,740
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
411
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.

Level 50
363,740 XP
Oct
24
2 days ago
Activity icon

Replied to What Is The Best Package For Shopping Cart?

@sanjayacloud

Here is a tutorial for shopping cart with this package. It's in french but code is ok ;)

Oct
18
1 week ago
Oct
15
1 week ago
Activity icon

Replied to What Is The Best Package For Shopping Cart?

Don't know which is the best but I used this one in a recent project and it's clean and easy.

Activity icon

Replied to Use Input Class In Laravel Blade File

As you use Laravel Collective considering using form model binding to get automatically old input.

Oct
13
1 week ago
Oct
12
2 weeks ago
Activity icon

Replied to How To Notify Comment Owner And Not Auth User

But you get the value just before on this line :

$reply = Reply::create($request->all());
Activity icon

Replied to How To Notify Comment Owner And Not Auth User

I didn't see this useless parameter, do that :

public function store(Request $request)
    {
        $reply = Reply::create($request->all());

        $reply->comment->user->notify(new RepliedToComment($reply));
        
        return redirect()->back()->with('success', 'Reply Submitted Successfuly');
    }

But not sure for reply value in notification...

Activity icon

Replied to Laravel Resource Route With Controller In Subdirectory In Laravel 8

You must add all directory after base namespace, like we did with previous Laravel versions.

Activity icon

Replied to How To Notify Comment Owner And Not Auth User

I don't see why your relation doesn't work...

Activity icon

Replied to How To Notify Comment Owner And Not Auth User

Is comment_id in hidden input in form ?

Activity icon

Replied to How To Notify Comment Owner And Not Auth User

@mahmoudmonem I changed my answer, doesn't work now ?

Activity icon

Replied to Laravel Resource Route With Controller In Subdirectory In Laravel 8

You also can return to old way in RouteServiceProvider :

protected $namespace = 'App\Http\Controllers';
Activity icon

Replied to Laravel Is Treating POST Request As GET Request

Are you sure there is not another route before this one with same url scheme and GET method ? Take care about route order.

Activity icon

Replied to Laravel Is Treating POST Request As GET Request

It is not Laravel code, the method is got from Symfony\Component\HttpFoundation\Request with getMethod function :

public function getMethod()
{
    if (null !== $this->method) {
        return $this->method;
    }

    $this->method = strtoupper($this->server->get('REQUEST_METHOD', 'GET'));

    if ('POST' !== $this->method) {
        return $this->method;
    }

    $method = $this->headers->get('X-HTTP-METHOD-OVERRIDE');

    if (!$method && self::$httpMethodParameterOverride) {
        $method = $this->request->get('_method', $this->query->get('_method', 'POST'));
    }

    if (!\is_string($method)) {
        return $this->method;
    }

    $method = strtoupper($method);

    if (\in_array($method, ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'PATCH', 'PURGE', 'TRACE'], true)) {
        return $this->method = $method;
    }

    if (!preg_match('/^[A-Z]++$/D', $method)) {
        throw new SuspiciousOperationException(sprintf('Invalid method override "%s".', $method));
    }

    return $this->method = $method;
}

You should debug there to understand your issue.

Oct
11
2 weeks ago
Activity icon

Awarded Best Reply on Redundant Code

For example in App\Http\Controllers\Controller :

class Controller extends BaseController
{
    ...

    protected function getDb()
    {
        return auth()->user()->schools->first()->schl_sys_id;
    }
}

And in all your controllers just call this function :

$this->getDb()
Activity icon

Awarded Best Reply on Regex Check

Maybe :

const reg = /^[A-Za-z.,]+$/
Activity icon

Replied to Regex Check

Maybe :

const reg = /^[A-Za-z.,]+$/
Activity icon

Replied to Redundant Code

For example in App\Http\Controllers\Controller :

class Controller extends BaseController
{
    ...

    protected function getDb()
    {
        return auth()->user()->schools->first()->schl_sys_id;
    }
}

And in all your controllers just call this function :

$this->getDb()
Activity icon

Replied to First Item On The List Doesn't Display Its Necessary <form> Tag

@sinnbeck

You're right, form tag can be used where flow content is expected, so td is ok.

Activity icon

Replied to Redundant Code

If it concerns all controllers use inheritance with a method in App\Http\Controllers\Controller.

Activity icon

Replied to First Item On The List Doesn't Display Its Necessary <form> Tag

A form tag is not allowed in a table, but you can use a form attribute.

Oct
10
2 weeks ago
Activity icon

Replied to Quering Relationship With Current User

You also can start from user (with lessons relation) :

$query = auth()->user()->lessons()
  ->where('title', 'like', '%'.$this->search.'%')
  ->when($subject, function ($query, $subject) {
    return $query->where('subject_id', $subject);
})->get();
Activity icon

Awarded Best Reply on MYSQL Table Already Exists.

;)

Activity icon

Replied to MYSQL Table Already Exists.

Do the same on permissions table.

Activity icon

Replied to MYSQL Table Already Exists.

In users migration you have this ?

$table->id();
Activity icon

Replied to Quering Relationship With Current User

How is the whole query ?

Activity icon

Replied to MYSQL Table Already Exists.

If it's a fresh project refresh migration :

php artisan migrate:fresh
Activity icon

Replied to MYSQL Table Already Exists.

Try :

$table->unsignedBigInteger('user_id');
Activity icon

Replied to MYSQL Table Already Exists.

The 2 columns must have the same type in the 2 tables : id and user_id.

Could you show the 2 migrations ?

Oct
07
2 weeks ago
Activity icon

Replied to Taylor Discusses Jetstream And Laravel UI

@thewebartisan7

So you made Jetstream without Jetstream :)

Activity icon

Replied to Taylor Discusses Jetstream And Laravel UI

@thewebartisan7

It's possible to use laravel UI views with Fortify, it's a good start point to change frontend. I showed it in this french article.

Activity icon

Replied to Is There A Laravel Helper To Reverse A Slug?

There are archaeologists there :)

Activity icon

Replied to How To Display Image?

I think you should read the file storage documentation.

Activity icon

Replied to Taylor Discusses Jetstream And Laravel UI

@jlrdw

I mean Fortify, without Jetstream, and with custom views.

Activity icon

Replied to Taylor Discusses Jetstream And Laravel UI

@jlrdw

I'm great thanks, hope you are too ;)

Thank you for the fast review. I like Fortify, it's really easy to use with custom views.

Activity icon

Replied to How To Pass Data To Controller In Laravel From Route: Laravel 8

@michaloravec @automica

He wants variable at route level, I really don't understand why ^^

Activity icon

Replied to Taylor Discusses Jetstream And Laravel UI

Would be great to have a text transcription for no english people (like me) that can't understand vocal version !

Activity icon

Replied to How To Pass Data To Controller In Laravel From Route: Laravel 8

It's an odd ask but why not ?

You can get it with a route middleware :

<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;

class SetName
{
    public function handle(Request $request, Closure $next)
    {
        $request->name = 'Mr. Perfectionist';
        return $next($request);
    }
}

Add it in Kernel :

protected $routeMiddleware = [
    ...
    'name' => \App\Http\Middleware\SetName::class,
];

Add middleware in your route :

use App\Http\Controllers\DateController;
Route::get('/', [ DateController::class, 'holiday' ])->middleware('name');

Then in your controller :

class DateController extends Controller
{
  public function holiday(Request $request) {
      return $request->name;
  }
}
Oct
05
3 weeks ago
Activity icon

Replied to Use Laravel/ui In Laravel 8

I think it's not a good idea to use laravel/ui on V8. For me the good way is to use Fortify without Jetstream and use any views like laravel/ui ones. I showed it in this article, text is in french but should work with translation.

Aug
12
2 months ago
Activity icon

Replied to Pass Html String To View Having Eloquent Syntax

$data->column = '< span > Hello ' . $data->column . '< / span >';

Ans simply in view :

{!! $data->column !!}
Activity icon

Replied to Pass Html String To View Having Eloquent Syntax

Why not add SPAN in view ?

Activity icon

Replied to Pass Html String To View Having Eloquent Syntax

hello,

You still have the value so in view :

{!! $data->column !!}

And only :

return view('bladePage', compact('data'));
Activity icon

Replied to Testing For Specific Validation Errors

There is an example in this tutorial at chapter Testing URL Validation. Hope it helps.

Activity icon

Replied to How To Make An Admin Panel For Free

It's really easy to integrate Admin-LTE, I wrote a little article on it, in french but code is universal.