Use Provider DB

3 years ago

MasterRO94

Fetch first Service Provider and set account databaase connection

Code

use Faker\Factory;
use App\Models\User;
use Illuminate\Support\Carbon;
use BookingSystem\Models\{
  Booking,
  Service,
  Location,
  ServiceUnit,
  ExtraService,
};
use App\Events\BookingCreated;

$faker = Factory::create();
$provider = User::providers()
  ->first()
  ->accountUser();

App\Models\Database::findFor($provider)->use();

Output

New course: Desktop apps with Electron