diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index 4031bc8..67c6132 100755 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -20,8 +20,7 @@ class AdminController extends Controller public function index() { $userId = Auth::user()->id; - $name = Auth::user()->name; - + $littlelink_name = Auth::user()->littlelink_name; $links = Link::where('user_id', $userId)->select('link')->count(); $clicks = Link::where('user_id', $userId)->sum('click_number'); @@ -29,7 +28,7 @@ class AdminController extends Controller $siteLinks = Link::count(); $siteClicks = Link::sum('click_number'); - return view('panel/index', ['name' => $name, 'links' => $links, 'clicks' => $clicks, 'siteLinks' => $siteLinks, 'siteClicks' => $siteClicks, 'userNumber' => $userNumber]); + return view('panel/index', ['littlelink_name' => $littlelink_name, 'links' => $links, 'clicks' => $clicks, 'siteLinks' => $siteLinks, 'siteClicks' => $siteClicks, 'userNumber' => $userNumber]); } //Get users by type @@ -110,7 +109,7 @@ class AdminController extends Controller User::where('id', $id)->update(['name' => $name, 'email' => $email, 'password' => $password, 'littlelink_name' => $littlelink_name, 'littlelink_description' => $littlelink_description, 'role' => $role]); if(!empty($profilePhoto)){ - $profilePhoto->move(public_path('/img'), $name . ".png"); + $profilePhoto->move(public_path('/img'), $littlelink_name . ".png"); } return back(); diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index b38bad2..59c7dbf 100755 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -21,13 +21,13 @@ class UserController extends Controller { $userId = Auth::user()->id; - $name = Auth::user()->name; + $littlelink_name = Auth::user()->littlelink_name; $links = Link::where('user_id', $userId)->select('link')->count(); $clicks = Link::where('user_id', $userId)->sum('click_number'); - return view('studio/index', ['name' => $name, 'links' => $links, 'clicks' => $clicks]); + return view('studio/index', ['littlelink_name' => $littlelink_name, 'links' => $links, 'clicks' => $clicks]); } //Show littlelink page. example => http://127.0.0.1:8000/+admin @@ -175,7 +175,7 @@ class UserController extends Controller public function editPage(request $request) { $userId = Auth::user()->id; - $username = Auth::user()->name; + $littlelink_name = Auth::user()->littlelink_name; $profilePhoto = $request->file('image'); $pageName = $request->pageName; @@ -184,7 +184,7 @@ class UserController extends Controller User::where('id', $userId)->update(['littlelink_name' => $pageName, 'littlelink_description' => $pageDescription]); if(!empty($profilePhoto)){ - $profilePhoto->move(public_path('/img'), $username . ".png"); + $profilePhoto->move(public_path('/img'), $littlelink_name . ".png"); } return back(); diff --git a/resources/views/panel/index.blade.php b/resources/views/panel/index.blade.php index c0df24a..f1a1045 100755 --- a/resources/views/panel/index.blade.php +++ b/resources/views/panel/index.blade.php @@ -2,7 +2,7 @@ @section('content') -

👋 Hi {{ $name }}

+

👋 Hi {{ $littlelink_name }}

Wellcome to littlelink. You are ready to raise links?! 😉 diff --git a/resources/views/studio/index.blade.php b/resources/views/studio/index.blade.php index 57e836f..196f6f1 100755 --- a/resources/views/studio/index.blade.php +++ b/resources/views/studio/index.blade.php @@ -2,7 +2,7 @@ @section('content') -

👋 Hi {{ $name }}

+

👋 Hi {{ $littlelink_name }}

Wellcome to littlelink. You are ready to raise links?! 😉 diff --git a/resources/views/studio/profile.blade.php b/resources/views/studio/profile.blade.php index e70328f..433067a 100755 --- a/resources/views/studio/profile.blade.php +++ b/resources/views/studio/profile.blade.php @@ -8,7 +8,7 @@ @csrf @foreach($profile as $profile)

- +