У меня есть пользовательская модель как:
<?php
namespace App;
use App\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\Notification;
use Illuminate\Notifications\RoutesNotifications;
use Notifications\EmailClientOfAccount;
class User3 extends User
{
use Notifiable;
public $emailList;
protected $fillable = [
'name', 'email',
];
public function __construct($emails)
{
$this->emailList = $emails;
}
public function getEmailList()
{
return $this->emailList;
}
public static function all(array $columns=[])
{
return $emailList;
}
public function routeNotificationForMail($notification)
{
return $this->email;
}
}
Затем и в контроллере:
$collection = collect([
[ 'name' => 'user1', 'email' => 'user1@gmail.com', ], [ 'name' => 'user2',
'email' => 'user2@gmail.com', ], [ 'name' => 'user1000', 'email' =>
'user1000@gmail.com', ],
]);
Второй этап: $ u4 = new User3 ($ collection);когда я использую:
dd($u4::all());
Это показывает ниже ошибку: ErrorException: Объявление App \ User3 :: all (array $ columns = Array) должно быть совместимо с Illuminate \ Database \ Eloquent \ Model :: all ($ columns = Array)
Я очень стараюсь решить, но не очень, спасибо за любую помощь,