Mohammad79

Member Since 5 Months Ago

Experience Points
680
Total
Experience

4,320 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
2
Lessons
Completed
Best Reply Awards
0
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 1
680 XP
Apr
05
1 week ago
Activity icon

Replied to Error Sending Email

Does anyone know? :(

Apr
04
1 week ago
Activity icon

Replied to Error Sending Email

Thanks for the reply

smtp directAdmin

Activity icon

Started a new Conversation Error Sending Email

Hello everyone, the email is sent correctly on the local, but in server encounters an error

ErrorException: fwrite(): SSL operation failed with code 1. OpenSSL Error messages:
error:140D00CF:SSL routines:SSL_write:protocol is shutdown

please guide me

Mar
31
1 week ago
Activity icon

Awarded Best Reply on Problem Uploading Laravel Project

Phar is installed on the server

But I solved the problem with this

"config": {
		 "platform-check": false
    },

But anyway, thank you for your answer

Activity icon

Replied to Problem Uploading Laravel Project

Phar is installed on the server

But I solved the problem with this

"config": {
		 "platform-check": false
    },

But anyway, thank you for your answer

Activity icon

Started a new Conversation Problem Uploading Laravel Project

Hello everyone, I uploaded my Laravel project on the host, I encountered this problem, does anyone have a solution?

Composer detected issues in your platform: Your Composer dependencies require the following PHP extensions to be installed: phar
Mar
13
1 month ago
Activity icon

Started a new Conversation Avoid Sending Too Many Comments In One Minute

Hello everyone, how can I prevent a user from sending multiple comments in one minute?

I know Throttle can be used

But it can not be customized?

public function checkSpam()
    {
             return Carbon::now()->toArray()['minute'] ==$this->comments()->latest()->first()->created_at
			->toArray()['minute'];

    }

I know this's wrong, but I just want to not be able to leave multiple comments in one minute

Mar
11
1 month ago
Activity icon

Started a new Conversation How Customize The Throttle Class?

Hello everyone, I want to customize the Throttle class and put my desired text how should I do this?

I just made a middleware and she inherits from the ThrottleRequests class and I added it to the kernel

class customThrottleRequest extends ThrottleRequests
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle(Request $request, Closure $next)
    {
        return $next($request);
    }
}
Mar
06
1 month ago
Activity icon

Replied to Apply Multiple Queries String To The Url

@sergiu17 @tykus

Thanks to both of you friends

The same problem still exists , I think I conveyed my meaning badly

When a user searches for an article

for example

http://localhost:8000/articles?search=something

And if it does the next filter, the url will look like this and the search query will be lost

http://localhost:8000/articles?category=something

I want all filters to remain and be added like this

http://localhost:8000/articles?search=something&category=something
Activity icon

Started a new Conversation Apply Multiple Queries String To The Url

Hi everyone

I have 4 filters for the article

public static function userSearch($article,$request)
    {
        $article=$article::query();

        if ($request->has('search') ){
            $article=$article->where("title","LIKE","%$request->search%");
        }
        if ($request->has('category')){
            $article=Category::where('name',$request->category)->first()->articles();
        }
        if ($request->has('orderBy')){
            $article = self::orderByArticle($request, $article);
        }
        if ($request->has('tag')){
          $article=Tag::where('name',$request->tag)->first()->articles();
        }

        if (!$article->count()){
            return false;
        }
        return $article->latest()->paginate(12);
    }

I want every request to join in the url like this

?search=something & category=something & tag=somtehing

But now like this

?search=something Or  category=something Or tag=somtehing  

Only one of them applies

Excuse me if I explained vaguely 😶

Activity icon

Replied to How To Make Relationship With Post And User In Like Table

There are different ways to have a relationship

But a simple method for your question

post model

	public function user()
    {
        return $this->belongsTo(User::class);
    }

	public function likes()
    {
        return $this->hasMany(Like::class);
    }

user model

public function posts()
    {
        return $this->hasMany(Post::class);
    }

public function likes()
    {
        return $this->hasMany(Like::class);
    }

like model

   public function user()
    {
        return $this->belongsTo(User::class);
    }

   public function post()
    {
        return $this->belongsTo(Post::class);
    }

Mar
05
1 month ago
Activity icon

Replied to Send Mail

try


MAIL_PORT=2525
MAIL_ENCRYPTION=tls


OR


MAIL_PORT=465
MAIL_ENCRYPTION=tls

Activity icon

Replied to Send The Wrong Url To The User's Email By Queuing To Verify The Email

I did this before and it didn't work but it worked now 🙁. thanks bro 🙂

Activity icon

Replied to Send The Wrong Url To The User's Email By Queuing To Verify The Email

It did not work and it sends the same url

Mar
04
1 month ago
Activity icon

Started a new Conversation Send The Wrong Url To The User's Email By Queuing To Verify The Email

Hi everyone

Works well when I want to use Laravel's default email verifier But when I put the same method that sends the email in a queue, the url sent to the user is wrong

http://localhost/email/verify/65/36a5c019a9dc059333f38c329f3694d6ba646e36?expires=1614871373&signature=52f2f377d559a6bdd913b6fc210106b352ed1c60ff64cf1166d2b0ec562f086d

The above url is incorrect instead of localhost:8000 has only the localhost value

	User   Model 

 public function sendEmailVerificationNotification()
    {
        sendEmailVerify::dispatch($this);
    }


Job 

 public function __construct(User $user)
    {
   
        $this->user = $user;
    }
    
    public function handle()
    {
       $this->user->notify(new \App\Notifications\VerifyEmail());
    }
Activity icon

Replied to What Does "php Artisan Ui: Auth" Do

No it does not , you can also use vue or react

Activity icon

Replied to What Does "php Artisan Ui: Auth" Do

First you install the package

composer require laravel:ui  

php artisan ui bootstrap --auth  ||  php artisan ui vue --auth   ||   php artisan ui react --auth 
 
npm run dev 

Makes everything you need for authentication

Activity icon

Replied to Password Reset Does Not Work On Localhost

I use Laravel's default password reset system

Activity icon

Replied to Password Reset Does Not Work On Localhost

It works, thank you bro

Activity icon

Started a new Conversation Password Reset Does Not Work On Localhost

Hi , Isending an email for resetting the password does not work and gives an error after 15 seconds

Swift_TransportException
Connection could not be established with host smtp.mailtrap.io :stream_socket_client(): unable to connect to tcp://smtp.mailtrap.io:465 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

But it works properly for sending verification emails or other emails !

MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME= username 
MAIL_PASSWORD= password
MAIL_ENCRYPTION=tls
[email protected]
MAIL_FROM_NAME="${APP_NAME}"

If you have a solution, please share 😑

And I tried different methods to solve this problem, but it didn't work

for example

MAIL_PORT=2525  => MAIL_PORT=465
MAIL_ENCRYPTION=tls => MAIL_ENCRYPTION=ssl
Mar
03
1 month ago
Activity icon

Replied to Fatal Error: Uncaught Mysqli_sql_exception: Column 'topic' Cannot Be Null

Where is it defined $topic?

 $display_sub_topics->bind_result($topic, $created_by);

or

$topic = $topic ?? $topic;

Feb
28
1 month ago
Activity icon

Replied to How Can I Reduce The Number Of Queries?

Thank you so much for this tip , I was able to find a solution 🙂

Activity icon

Replied to How Can I Reduce The Number Of Queries?

 public function getCommentActive()
    {
        return $this->comments()->where([
            ['status',1],
    ])->get();
    }
Activity icon

Replied to How Can I Reduce The Number Of Queries?

I know this, but my problem is something else

@forelse($article->getCommentActive() as $comment)
            
            @foreach($comment->admin as $admin)
                {{--something--}}
            @endforeach
@empty
   
@endforelse
Activity icon

Started a new Conversation How Can I Reduce The Number Of Queries?

Hello friends I implemented the comment system in the Laravel project and everything was ok, but when the admin responds to user comments, a query for the comment is executed by the admin, even those comments that the admin did not respond.


public function admin()
    {
        return $this->hasMany(Comment::class,'parent_id','id');
    }
 @foreach($comment->admin as $admin)
	                {{--something--}}
@endforeach

How can I reduce the number of queries?

Feb
10
2 months ago
Activity icon

Replied to Production.ERROR: Undefined Variable: Id Laravel Blade

if($request->input('identity_id')){
                   return view('performance_dashboard', $id);
                }
if($request->input('identity_id')){
                   return view('performance_dashboard', ['id'=>$id]);
                }