PhpStorm laravel 5 method not found

后端 未结 1 1555
攒了一身酷
攒了一身酷 2021-01-19 07:11

Im f*cking crazy whith PhpStorm when tried to fix a popular error Method \'Bla bla\' not found in class.

I have been searching for days in google whith

1条回答
  •  不思量自难忘°
    2021-01-19 07:48

    I ran "php artisan ide-helper:models" -> Yes, it wrote some line in my models file and still not work I ran again "php artisan ide-helper:models" -> No, it created a new file called _ide_helper_models.php file but still not work.

    FINALLY

    I access file _ide_helper_models.php and add this function into class Article it work xD

    /**
     * Add an "order by" clause for a timestamp to the query.
     *
     * @param string $column
     * @return \Illuminate\Database\Query\Builder|static 
     * @static 
     */
    public static function latest($column = 'created_at'){
        return \Illuminate\Database\Query\Builder::latest($column);
    }
    

    0 讨论(0)
提交回复
热议问题