Opa silestrini, não deu certo meu caro.
Veja no que deu:
lucianogr@lucianogr-Inspiron-15-3520:~/Projects/shortlink/shortlink$ php artisan migrate:fresh
Route::get('/', function () {
return view('welcome');
});
Route::post('/shorten', [App\Http\Controllers\ShortLinkController::class, 'store'])->name('shorten');
Route::get('{shortCode}', [App\Http\Controllers\ShortLinkController::class, 'show'])->name('shortlink.show');
Illuminate\Database\QueryException
Database (shortlinkdb) does not exist. (SQL: PRAGMA foreign_keys = ON;)
at vendor/laravel/framework/src/Illuminate/Database/Connection.php:712
708▕ // If an exception occurs when attempting to run a query, we'll format the error
709▕ // message to include the bindings with SQL, which will make this exception a
710▕ // lot more helpful to the developer instead of just the database's errors.
711▕ catch (Exception $e) {
➜ 712▕ throw new QueryException(
713▕ $query, $this->prepareBindings($bindings), $e
714▕ );
715▕ }
716▕ }
+41 vendor frames
42 artisan:37
Illuminate\Foundation\Console\Kernel::handle()
lucianogr@lucianogr-Inspiron-15-3520:~/Projects/shortlink/shortlink$ php artisan migrate
Route::get('/', function () {
return view('welcome');
});
Route::post('/shorten', [App\Http\Controllers\ShortLinkController::class, 'store'])->name('shorten');
Route::get('{shortCode}', [App\Http\Controllers\ShortLinkController::class, 'show'])->name('shortlink.show');
Illuminate\Database\QueryException
Database (shortlinkdb) does not exist. (SQL: PRAGMA foreign_keys = ON;)
at vendor/laravel/framework/src/Illuminate/Database/Connection.php:712
708▕ // If an exception occurs when attempting to run a query, we'll format the error
709▕ // message to include the bindings with SQL, which will make this exception a
710▕ // lot more helpful to the developer instead of just the database's errors.
711▕ catch (Exception $e) {
➜ 712▕ throw new QueryException(
713▕ $query, $this->prepareBindings($bindings), $e
714▕ );
715▕ }
716▕ }
+35 vendor frames
36 artisan:37
Illuminate\Foundation\Console\Kernel::handle()
lucianogr@lucianogr-Inspiron-15-3520:~/Projects/shortlink/shortlink$
O ,env mudei assim e salvei.
DB_CONNECTION=sqlite
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=shortlinkdb
DB_USERNAME=root
DB_PASSWORD=5577azcD@#