Skip to content

Commit 3dee78f

Browse files
authored
Merge pull request #9 from HijenHEK/dev
Dev
2 parents 550c10c + 9d40806 commit 3dee78f

File tree

7 files changed

+5079
-23953
lines changed

7 files changed

+5079
-23953
lines changed

app/Http/Controllers/UserController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ class UserController extends Controller
1010

1111
public function __invoke(Request $request)
1212
{
13-
return response()->json($request->user());
13+
if(auth()->check()){
14+
return response()->json(auth()->user());
15+
}
1416
}
1517
}

app/Http/Controllers/VerificationController.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@
33
namespace App\Http\Controllers;
44

55
use App\Models\User;
6-
use Illuminate\Auth\Access\AuthorizationException;
7-
use Illuminate\Foundation\Auth\VerifiesEmails;
86
use Illuminate\Http\Request;
97

108
class VerificationController extends Controller
119
{
1210
//
13-
use VerifiesEmails;
1411

1512
/**
1613
* Mark the authenticated user's email address as verified.

package-lock.json

Lines changed: 5062 additions & 23934 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@
1010
"production": "mix --production"
1111
},
1212
"devDependencies": {
13-
"@vue/compiler-sfc": "^3.0.11",
14-
"autoprefixer": "^10.2.5",
15-
"axios": "^0.21",
16-
"laravel-mix": "^6.0.0-beta.17",
13+
"@vue/compiler-sfc": "^3.2.31",
14+
"autoprefixer": "^10.4.4",
15+
"axios": "^0.21.4",
16+
"laravel-mix": "^6.0.43",
1717
"lodash": "^4.17.19",
18-
"postcss": "^8.2.12",
19-
"tailwindcss": "^2.1.1",
20-
"vue": "^3.0.11",
21-
"vue-loader": "^16.2.0"
18+
"postcss": "^8.4.12",
19+
"tailwindcss": "^2.2.19",
20+
"vue": "^3.2.31",
21+
"vue-loader": "^16.8.3"
2222
},
2323
"dependencies": {
24-
"@heroicons/vue": "^1.0.1",
24+
"@heroicons/vue": "^1.0.6",
2525
"moment": "^2.29.1",
26-
"vue-router": "^4.0.6",
27-
"vuex": "^4.0.0",
26+
"vue-router": "^4.0.14",
27+
"vuex": "^4.0.2",
2828
"vuex-shared-mutations": "^1.0.2"
2929
}
3030
}

resources/js/store/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export default createStore({
7979
await axios.get('/api/user').then((res) => {
8080
commit('setUser', res.data);
8181
}).catch((err) => {
82-
82+
throw err.response
8383
})
8484
},
8585
async profile({commit},payload) {

resources/views/welcome.blade.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
<title>Laravel</title>
88

9-
<!-- Fonts -->
10-
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap" rel="stylesheet">
119

1210
<!-- Styles -->
1311
<style>

routes/api.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@
3838
Route::middleware('auth:sanctum')->group(function () {
3939
Route::patch('/profile', ProfileController::class);
4040
Route::patch('/password', PasswordController::class);
41-
Route::get('/user', UserController::class);
41+
4242
Route::post('/logout', [AuthController::class, 'logout']);
4343

4444
// in app verification
4545
// Route::post('/verify-email/{id}/{hash}', [VerificationController::class, 'verify'])->name('verify');
4646
// Route::post('/verify-resend', [VerificationController::class, 'resend']);
4747
});
48+
Route::get('/user', UserController::class);

0 commit comments

Comments
 (0)