You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?php
namespace App\Models;
use MongoDB\Laravel\Eloquent\Model;
class Test extends Model
{
protected $connection = 'mongodb';
protected $fillable = [
'Test'
];
}
----------
<?php
namespace App\Http\Controllers;
use App\Models\Json;
use Illuminate\Http\Request;
class JsonController extends Controller
{
public function postTestForm(Request $request)
{
try {
$test = Test::create([
'Test' => $request->get('test'),
]);
$test->save();
return 'success test has been successfully created';
} catch (\Exception $e) {
return 'Error: ' . $e->getMessage();
}
}
}
Expected behaviour
I should get a new object in my database.
Actual behaviour
First, I never had to specify a 'host' with laravel 9 and jenssegers/mongodb but now i got ' "Error: Undefined array key "host""'.
So i have tried to had a host in my database config.
Then, when I try another time to postTestForm with the host added I got a return 'success test has been successfully created' but nothing is created in my database.
I have tried with v4.0.0-ALPHA1 and v4.0.0-ALPHA2.
I don't have this problem with laravel 9 and jenssegers package.
The text was updated successfully, but these errors were encountered:
Description:
Steps to reproduce
Expected behaviour
I should get a new object in my database.
Actual behaviour
First, I never had to specify a 'host' with laravel 9 and jenssegers/mongodb but now i got ' "Error: Undefined array key "host""'.
So i have tried to had a host in my database config.
Then, when I try another time to postTestForm with the host added I got a return 'success test has been successfully created' but nothing is created in my database.
I have tried with v4.0.0-ALPHA1 and v4.0.0-ALPHA2.
I don't have this problem with laravel 9 and jenssegers package.
The text was updated successfully, but these errors were encountered: