📌  相关文章
📜  未定义 Maatwebsite\Excel\Concerns\WithHeadingRow - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:31.148000             🧑  作者: Mango

代码示例1
namespace App\Imports;

use App\User;
use Maatwebsite\Excel\Concerns\ToModel;
use Maatwebsite\Excel\Concerns\WithHeadingRow;

class UsersImport implements ToModel, WithHeadingRow
{
    public function model(array $row)
    {
        return new User([
            'name'  => $row['name'],
            'email' => $row['email'],
            'at'    => $row['at_field'],
        ]);
    }
}