mohammed_alama

mohammed_alama

Member Since 3 Months Ago

Experience Points
4,270
Total
Experience

730 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
41
Lessons
Completed
Best Reply Awards
0
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 1
4,270 XP
Sep
24
3 weeks ago
Activity icon

Replied to Overwrite Order In SqlQuery

@terreporter Yes but it seem all code is right i follow jeffery second by second I can't figure out whare is the mistake

Sep
23
3 weeks ago
Activity icon

Replied to Overwrite Order In SqlQuery

@terreporter I have dd() in popular method it does not make any effect

Sep
22
3 weeks ago
Activity icon

Replied to Overwrite Order In SqlQuery

I hava already add it to ThreadsFilter class

Activity icon

Started a new conversation Overwrite Order In SqlQuery

Hi I'am in lesseon 17 from forum series when @Jeffrey_way make popular filter he write

protected function popular(){
     $this->builder->getQuery()->orders = [];
     return $this->builder->orderBy('replies_count','desc');
}

to overwrite this

 $threads = Thread::latest()->filter($filters);

the problem when go to url

forum.test/threads?popular=1

apply

dd($threads->toSql());

it give me that query

"select `threads`.*, (select count(*) from `replies` where `threads`.`id` = `replies`.`thread_id`) as `replies_count` from `threads` order by `created_at` desc"

it supposed to overwrite

order by 'created_at' desc

and make it

order by 'replies_count' desc

BTW Laravel is v6

Sep
17
1 month ago
Activity icon

Replied to Did Any One Try Themosis With Valet Before ?

write

require_once  __DIR__.'ThemosisValetDriver.php';

in require.php in drivers folder and add this to ValetDriver.php

$drivers[] = 'ThemosisValetDirver';

this code of ThemosisValetDriver.php

<?php
class ThemosisValetDriver extends BasicValetDriver
{
    /**
     * Determine if the driver serves the request.
     *
     * @param  string  $sitePath
     * @param  string  $siteName
     * @param  string  $uri
     * @return bool
     */
    public function serves($sitePath, $siteName, $uri)
    {
        return is_dir($sitePath.'/htdocs/cms');
    }

   /**
     * Get the fully resolved path to the application's front controller.
     *
     * @param  string  $sitePath
     * @param  string  $siteName
     * @param  string  $uri
     * @return string
     */
    public function frontControllerPath($sitePath, $siteName, $uri)
    {
        $_SERVER['PHP_SELF']    = $uri;
        $_SERVER['SERVER_ADDR'] = '127.0.0.1';
        $_SERVER['SERVER_NAME'] = $_SERVER['HTTP_HOST'];
        return parent::frontControllerPath(
            $sitePath.'/htdocs', $siteName, $this->forceTrailingSlash($uri)
        );
    }
    /**
     * Redirect to uri with trailing slash.
     *
     * @param  string $uri
     * @return string
     */
    private function forceTrailingSlash($uri)
    {
        if (substr($uri, -1 * strlen('/wp-admin')) == '/wp-admin') {
            header('Location: '.$uri.'/'); die;
        }
        return $uri;
    }
}

Jul
23
2 months ago
Activity icon

Replied to SQL Cannot Add Forign Key

same error

Activity icon

Replied to SQL Cannot Add Forign Key

where i can check engine..?

Activity icon

Replied to SQL Cannot Add Forign Key

Now it add the owenr_id to table but i have another migration file called create_task_tabel it does noe migrated and add to tables..? it is weird thing

Jul
22
2 months ago
Activity icon

Started a new conversation SQL Cannot Add Forign Key

Hi i have error when hit artisan migrate:fresh to add forign key of user in projects migration

it show me that error

Illuminate\Database\QueryException : SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table `projects` add constraint `projects_owner_id_foreign` foreign key (`owner_id`) references `users` (`id`) on delete cascade)

and this is projects migration

  public function up()
    { 
        Schema::create('projects', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('owner_id')->unsigned();
            $table->string('title');
            $table->text('description');
            $table->timestamps();
       });
        Schema::table('projects', function($table) {
              $table->foreign('owner_id')
                  ->references('id')
                  ->on('users')
                  ->onDelete('cascade');
        });
    }