Skip to content

Commit 6fa9e9e

Browse files
committed
✨ ajout du profil linkedin chez l'utilisateur
1 parent 3a3da41 commit 6fa9e9e

File tree

8 files changed

+78906
-15
lines changed

8 files changed

+78906
-15
lines changed

app/Http/Controllers/User/SettingController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function update(UpdateProfileRequest $request)
3434
'bio' => trim(strip_tags($request->bio)),
3535
'twitter_profile' => $request->twitter_profile,
3636
'github_profile' => $request->github_profile,
37+
'linkedin_profile' => $request->linkedin_profile,
3738
'phone_number' => $request->phone_number,
3839
'location' => $request->location,
3940
'website' => $request->website,

app/Models/User.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class User extends Authenticatable implements MustVerifyEmail, HasMedia
4242
'phone_number',
4343
'github_profile',
4444
'twitter_profile',
45+
'linkedin_profile',
4546
'website',
4647
'last_login_at',
4748
'last_login_ip',
@@ -219,6 +220,11 @@ public function twitter(): ?string
219220
return $this->twitter_profile;
220221
}
221222

223+
public function linkedin(): ?string
224+
{
225+
return $this->linkedin_profile;
226+
}
227+
222228
public function scopeModerators(Builder $query): Builder
223229
{
224230
return $query->whereHas('roles', function ($query) {
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
class AddLinkedinProfileColumnToUsersTable extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::table('users', function (Blueprint $table) {
17+
$table->string('linkedin_profile')
18+
->after('twitter_profile')
19+
->nullable();
20+
});
21+
}
22+
23+
/**
24+
* Reverse the migrations.
25+
*
26+
* @return void
27+
*/
28+
public function down()
29+
{
30+
Schema::table('users', function (Blueprint $table) {
31+
$table->dropColumn('linkedin_profile');
32+
});
33+
}
34+
}

public/css/app.css

Lines changed: 9751 additions & 10 deletions
Large diffs are not rendered by default.

public/js/app.js

Lines changed: 69093 additions & 2 deletions
Large diffs are not rendered by default.

public/mix-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"/js/app.js": "/js/app.js?id=6e9d959a77c0ed56a844",
3-
"/css/app.css": "/css/app.css?id=a4b94cf149d9afd5d3e5"
2+
"/js/app.js": "/js/app.js",
3+
"/css/app.css": "/css/app.css"
44
}

resources/views/user/profile.blade.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<p class="mt-2 text-skin-base font-normal">
6161
{{ $user->bio ?? '...' }}
6262
</p>
63-
<div class="mt-4 mb-6 flex items-center gap-x-3">
63+
<div class="mt-4 mb-6 flex items-center gap-x-4">
6464
@if ($user->githubUsername())
6565
<a href="https://github.com/{{ $user->githubUsername() }}" class="text-skin-base hover:text-skin-inverted">
6666
<x-icon.github class="w-6 h-6" />
@@ -72,6 +72,12 @@
7272
<x-icon.twitter class="w-6 h-6" />
7373
</a>
7474
@endif
75+
76+
@if ($user->linkedin())
77+
<a href="https://www.linkedin.com/in/{{ $user->linkedin() }}" class="text-skin-base hover:text-[#004182]">
78+
<x-icon.linkedin class="w-6 h-6" />
79+
</a>
80+
@endif
7581
</div>
7682
</div>
7783
<div>

resources/views/user/settings/profile.blade.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,18 @@
186186
:value="Auth::user()->githubUsername()"
187187
/>
188188
</div>
189+
<div class="max-w-lg flex">
190+
<x-input
191+
type="text"
192+
name="linkedin_profile"
193+
id="linkedin_profile"
194+
aria-label="Profil LinkedIn"
195+
leading-addon="linkedin.com/in/"
196+
container-class="flex-1"
197+
container-input-class="flex"
198+
:value="Auth::user()->linkedin()"
199+
/>
200+
</div>
189201
</div>
190202
</div>
191203
</div>

0 commit comments

Comments
 (0)