What errors do you get?
Update blob image
Hello, I need to upload blob file to database for user registration, but I can't.
This is my code:
User.php protected $fillable = [ 'name', 'email', 'password', 'img' ];
Migration: public function up() { Schema::create('users', function (Blueprint $table) { $table->id(); $table->string('name'); $table->string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); $table->string('password'); $table->binary('img'); $table->rememberToken(); $table->timestamps(); }); }
RegistrerController.php
protected function validator(array $data) { return Validator::make($data, [ 'name' => ['required', 'string', 'max:255'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 'password' => ['required', 'string', 'min:8', 'confirmed'], 'img' => 'required' ]); }
protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
'img' => $data['img']
]);
}
Please or to participate in this conversation.