Skip to content

Commit 3d785d5

Browse files
Install font awesome icons
1 parent 3f068fb commit 3d785d5

File tree

13 files changed

+111
-111
lines changed

13 files changed

+111
-111
lines changed

app/Http/Controllers/UserController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use App\Http\Requests\UserStoreRequest;
66
use App\Models\User;
77
use Illuminate\Http\Request;
8+
use Illuminate\Support\Facades\Hash;
89
use Illuminate\Support\Facades\Storage;
910
use Inertia\Inertia;
1011

@@ -42,6 +43,7 @@ public function store(UserStoreRequest $request)
4243
$validatedData['avatar'] = Storage::url($avatarPath);
4344
}
4445

46+
$validatedData['password'] = Hash::make($validatedData['password']);
4547
User::create($validatedData);
4648

4749
return redirect()->route('users.index')->with('success', 'User has been created!');

app/Http/Middleware/HandleInertiaRequests.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use App\Models\Role;
66
use App\Models\User;
77
use Illuminate\Http\Request;
8+
use Illuminate\Support\Facades\Auth;
89
use Inertia\Middleware;
910

1011
class HandleInertiaRequests extends Middleware
@@ -47,7 +48,10 @@ public function share(Request $request): array
4748
'userCount' => User::count(),
4849
'roleCount' => Role::count(),
4950
],
50-
'avatar' => 'https://painrehabproducts.com/wp-content/uploads/2014/10/facebook-default-no-profile-pic.jpg'
51+
'avatar' => 'https://painrehabproducts.com/wp-content/uploads/2014/10/facebook-default-no-profile-pic.jpg',
52+
'auth' => [
53+
'user' => Auth::user()
54+
]
5155
]);
5256
}
53-
}
57+
}

package-lock.json

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

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,8 @@
1616
"tailwindcss": "^3.1.0",
1717
"vite": "^4.0.0",
1818
"vue": "^3.2.31"
19+
},
20+
"dependencies": {
21+
"@fortawesome/fontawesome-free": "^6.3.0"
1922
}
2023
}

resources/js/Components/Welcome.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import ApplicationLogo from '@/Components/ApplicationLogo.vue';
44

55
<template>
66
<div>
7-
<div class="p-6 lg:p-8 bg-white border-b border-gray-200">
8-
<ApplicationLogo class="block h-12 w-auto" />
7+
<div class="p-6 bg-white border-b border-gray-200 lg:p-8">
8+
<ApplicationLogo class="block w-auto h-12" />
99

1010
<h4 class="mt-8 text-2xl font-medium text-gray-900">
11-
Welcome to SPA - single project application demo project!
11+
Welcome to <b>SPA</b> - single project application demo project!
1212
</h4>
1313

14-
<p class="mt-6 text-gray-500 leading-relaxed">
14+
<p class="mt-6 leading-relaxed text-gray-500">
1515
This SPA offers an all-in-one solution for managing users and roles, featuring an easy-to-use dashboard
1616
for
1717
administrators.
@@ -29,7 +29,7 @@ import ApplicationLogo from '@/Components/ApplicationLogo.vue';
2929

3030
</div>
3131

32-
<div class="bg-gray-200 bg-opacity-25 grid grid-cols-1 md:grid-cols-2 gap-6 lg:gap-8 p-6 lg:p-8">
32+
<div class="grid grid-cols-1 gap-6 p-6 bg-gray-200 bg-opacity-25 md:grid-cols-2 lg:gap-8 lg:p-8">
3333
<div>
3434
<div class="flex items-center">
3535
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
@@ -48,7 +48,7 @@ import ApplicationLogo from '@/Components/ApplicationLogo.vue';
4848
class="inline-flex items-center font-semibold text-indigo-700">
4949
Explore the repository documentation
5050

51-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" class="ml-1 w-5 h-5 fill-indigo-500">
51+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" class="w-5 h-5 ml-1 fill-indigo-500">
5252
<path fill-rule="evenodd"
5353
d="M5 10a.75.75 0 01.75-.75h6.638L10.23 7.29a.75.75 0 111.04-1.08l3.5 3.25a.75.75 0 010 1.08l-3.5 3.25a.75.75 0 11-1.04-1.08l2.158-1.96H5.75A.75.75 0 015 10z"
5454
clip-rule="evenodd" />
@@ -75,7 +75,7 @@ import ApplicationLogo from '@/Components/ApplicationLogo.vue';
7575
class="inline-flex items-center font-semibold text-indigo-700">
7676
Explore the repository
7777

78-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" class="ml-1 w-5 h-5 fill-indigo-500">
78+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" class="w-5 h-5 ml-1 fill-indigo-500">
7979
<path fill-rule="evenodd"
8080
d="M5 10a.75.75 0 01.75-.75h6.638L10.23 7.29a.75.75 0 111.04-1.08l3.5 3.25a.75.75 0 010 1.08l-3.5 3.25a.75.75 0 11-1.04-1.08l2.158-1.96H5.75A.75.75 0 015 10z"
8181
clip-rule="evenodd" />

resources/js/Layouts/AppLayout.vue

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ const logout = () => {
3737
<div class="min-h-screen bg-gray-100">
3838
<nav class="bg-white border-b border-gray-100">
3939
<!-- Primary Navigation Menu -->
40-
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
40+
<div class="px-4 mx-auto max-w-7xl sm:px-6 lg:px-8">
4141
<div class="flex justify-between h-16">
4242
<div class="flex">
4343
<!-- Logo -->
44-
<div class="shrink-0 flex items-center">
44+
<div class="flex items-center shrink-0">
4545
<Link :href="route('dashboard')">
46-
<ApplicationMark class="block h-9 w-auto" />
46+
<ApplicationMark class="block w-auto h-9" />
4747
</Link>
4848
</div>
4949

@@ -62,13 +62,13 @@ const logout = () => {
6262
</div>
6363

6464
<div class="hidden sm:flex sm:items-center sm:ml-6">
65-
<div class="ml-3 relative">
65+
<div class="relative ml-3">
6666
<!-- Teams Dropdown -->
6767
<Dropdown v-if="$page.props.jetstream.hasTeamFeatures" align="right" width="60">
6868
<template #trigger>
6969
<span class="inline-flex rounded-md">
7070
<button type="button"
71-
class="inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-md text-gray-500 bg-white hover:text-gray-700 focus:outline-none focus:bg-gray-50 active:bg-gray-50 transition ease-in-out duration-150">
71+
class="inline-flex items-center px-3 py-2 text-sm font-medium leading-4 text-gray-500 transition duration-150 ease-in-out bg-white border border-transparent rounded-md hover:text-gray-700 focus:outline-none focus:bg-gray-50 active:bg-gray-50">
7272
{{ $page.props.auth.user.current_team.name }}
7373

7474
<svg class="ml-2 -mr-0.5 h-4 w-4" xmlns="http://www.w3.org/2000/svg"
@@ -112,7 +112,7 @@ const logout = () => {
112112
<DropdownLink as="button">
113113
<div class="flex items-center">
114114
<svg v-if="team.id == $page.props.auth.user.current_team_id"
115-
class="mr-2 h-5 w-5 text-green-400"
115+
class="w-5 h-5 mr-2 text-green-400"
116116
xmlns="http://www.w3.org/2000/svg" fill="none"
117117
viewBox="0 0 24 24" stroke-width="1.5"
118118
stroke="currentColor">
@@ -131,20 +131,22 @@ const logout = () => {
131131
</Dropdown>
132132
</div>
133133

134+
<!-- Profile avatar -->
135+
<img class="object-cover w-8 h-8 rounded-full"
136+
:src="$page.props.auth.user.avatar != 'placeholder' ? $page.props.auth.user.avatar : $page.props.avatar"
137+
alt="User profile image">
138+
134139
<!-- Settings Dropdown -->
135-
<div class="ml-3 relative">
140+
<div class="relative ml-3">
136141
<Dropdown align="right" width="48">
137142
<template #trigger>
138143
<button v-if="$page.props.jetstream.managesProfilePhotos"
139-
class="flex text-sm border-2 border-transparent rounded-full focus:outline-none focus:border-gray-300 transition">
140-
<img class="h-8 w-8 rounded-full object-cover"
141-
:src="$page.props.auth.user.profile_photo_url"
142-
:alt="$page.props.auth.user.name">
144+
class="flex text-sm transition border-2 border-transparent rounded-full focus:outline-none focus:border-gray-300">
143145
</button>
144146

145147
<span v-else class="inline-flex rounded-md">
146148
<button type="button"
147-
class="inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-md text-gray-500 bg-white hover:text-gray-700 focus:outline-none focus:bg-gray-50 active:bg-gray-50 transition ease-in-out duration-150">
149+
class="inline-flex items-center px-3 py-2 text-sm font-medium leading-4 text-gray-500 transition duration-150 ease-in-out bg-white border border-transparent rounded-md hover:text-gray-700 focus:outline-none focus:bg-gray-50 active:bg-gray-50">
148150
{{ $page.props.auth.user.name }}
149151

150152
<svg class="ml-2 -mr-0.5 h-4 w-4" xmlns="http://www.w3.org/2000/svg"
@@ -155,6 +157,7 @@ const logout = () => {
155157
</svg>
156158
</button>
157159
</span>
160+
158161
</template>
159162

160163
<template #content>
@@ -186,11 +189,11 @@ const logout = () => {
186189
</div>
187190

188191
<!-- Hamburger -->
189-
<div class="-mr-2 flex items-center sm:hidden">
192+
<div class="flex items-center -mr-2 sm:hidden">
190193
<button
191-
class="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out"
194+
class="inline-flex items-center justify-center p-2 text-gray-400 transition duration-150 ease-in-out rounded-md hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500"
192195
@click="showingNavigationDropdown = !showingNavigationDropdown">
193-
<svg class="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
196+
<svg class="w-6 h-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
194197
<path
195198
:class="{ 'hidden': showingNavigationDropdown, 'inline-flex': !showingNavigationDropdown }"
196199
stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
@@ -217,16 +220,16 @@ const logout = () => {
217220
<!-- Responsive Settings Options -->
218221
<div class="pt-4 pb-1 border-t border-gray-200">
219222
<div class="flex items-center px-4">
220-
<div v-if="$page.props.jetstream.managesProfilePhotos" class="shrink-0 mr-3">
221-
<img class="h-10 w-10 rounded-full object-cover"
223+
<div v-if="$page.props.jetstream.managesProfilePhotos" class="mr-3 shrink-0">
224+
<img class="object-cover w-10 h-10 rounded-full"
222225
:src="$page.props.auth.user.profile_photo_url" :alt="$page.props.auth.user.name">
223226
</div>
224227

225228
<div>
226-
<div class="font-medium text-base text-gray-800">
229+
<div class="text-base font-medium text-gray-800">
227230
{{ $page.props.auth.user.name }}
228231
</div>
229-
<div class="font-medium text-sm text-gray-500">
232+
<div class="text-sm font-medium text-gray-500">
230233
{{ $page.props.auth.user.email }}
231234
</div>
232235
</div>
@@ -280,7 +283,7 @@ const logout = () => {
280283
<ResponsiveNavLink as="button">
281284
<div class="flex items-center">
282285
<svg v-if="team.id == $page.props.auth.user.current_team_id"
283-
class="mr-2 h-5 w-5 text-green-400" xmlns="http://www.w3.org/2000/svg"
286+
class="w-5 h-5 mr-2 text-green-400" xmlns="http://www.w3.org/2000/svg"
284287
fill="none" viewBox="0 0 24 24" stroke-width="1.5"
285288
stroke="currentColor">
286289
<path stroke-linecap="round" stroke-linejoin="round"
@@ -299,27 +302,27 @@ const logout = () => {
299302

300303
<!-- Page Heading -->
301304
<header v-if="$slots.header" class="bg-white shadow">
302-
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
305+
<div class="px-4 py-6 mx-auto max-w-7xl sm:px-6 lg:px-8">
303306
<slot name="header" />
304307
</div>
305308

306-
<div v-if="$page.props.flash.success" class="bg-indigo-900 text-center py-4 lg:px-4">
309+
<div v-if="$page.props.flash.success" class="py-4 text-center bg-indigo-900 lg:px-4">
307310
<div style="background-color: #6875F5"
308-
class="p-2 items-center text-indigo-100 leading-none lg:rounded-full flex lg:inline-flex"
311+
class="flex items-center p-2 leading-none text-indigo-100 lg:rounded-full lg:inline-flex"
309312
role="alert">
310313
<span
311-
class="flex rounded-full bg-indigo-500 uppercase px-2 py-1 text-xs font-bold mr-3">Success</span>
312-
<span class="font-semibold mr-2 text-left flex-auto">{{ $page.props.flash.success }}</span>
314+
class="flex px-2 py-1 mr-3 text-xs font-bold uppercase bg-indigo-500 rounded-full">Success</span>
315+
<span class="flex-auto mr-2 font-semibold text-left">{{ $page.props.flash.success }}</span>
313316
</div>
314317
</div>
315318

316-
<div v-if="$page.props.flash.delete" class="bg-indigo-900 text-center py-4 lg:px-4">
319+
<div v-if="$page.props.flash.delete" class="py-4 text-center bg-indigo-900 lg:px-4">
317320
<div style="background-color: #6875F5"
318-
class="p-2 items-center text-indigo-100 leading-none lg:rounded-full flex lg:inline-flex"
321+
class="flex items-center p-2 leading-none text-indigo-100 lg:rounded-full lg:inline-flex"
319322
role="alert">
320323
<span
321-
class="flex rounded-full bg-indigo-500 uppercase px-2 py-1 text-xs font-bold mr-3">Success</span>
322-
<span class="font-semibold mr-2 text-left flex-auto">{{ $page.props.flash.delete }}</span>
324+
class="flex px-2 py-1 mr-3 text-xs font-bold uppercase bg-indigo-500 rounded-full">Success</span>
325+
<span class="flex-auto mr-2 font-semibold text-left">{{ $page.props.flash.delete }}</span>
323326
</div>
324327
</div>
325328

resources/js/Pages/Dashboard.vue

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,10 @@ import Welcome from '@/Components/Welcome.vue';
55

66
<template>
77
<AppLayout title="Dashboard">
8-
<template #header>
9-
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
10-
Dashboard
11-
</h2>
12-
</template>
138

149
<div class="py-12">
15-
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
16-
<div class="bg-white overflow-hidden shadow-xl sm:rounded-lg">
10+
<div class="mx-auto max-w-7xl sm:px-6 lg:px-8">
11+
<div class="overflow-hidden bg-white shadow-xl sm:rounded-lg">
1712
<Welcome />
1813
</div>
1914
</div>

0 commit comments

Comments
 (0)