diff --git a/.env b/.env index 878566d..8fd94c4 100644 --- a/.env +++ b/.env @@ -8,6 +8,11 @@ NOTIFY_UPDATES=true DISPLAY_FOOTER=true DISPLAY_CREDIT=true +#Home URL=Changes if a user profile should be displayed as the homepage +#=Leave empty to use the default homepage. To set your profile as the homepage, enter a LittleLink name. You can find this on the user panel under the page setting, the name is what comes after the '@'. +#=(e.g. 'admin' without the '@') +HOME_URL= + #App Settings=Changes settings regarding your LittleLink Custom installation. You probably only want to change the App Name setting. #=App_Name changes the displayed name for the App in the title, for example. APP_NAME="LittleLink Custom" diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 1ff621f..4be643c 100755 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -48,6 +48,24 @@ class UserController extends Controller return view('littlelink', ['userinfo' => $userinfo, 'information' => $information, 'links' => $links, 'littlelink_name' => $littlelink_name]); } + //Show littlelink page as home page if set in config + public function littlelinkhome(request $request) + { + $littlelink_name = env('HOME_URL'); + $id = User::select('id')->where('littlelink_name', $littlelink_name)->value('id'); + + if (empty($id)) { + return abort(404); + } + + $userinfo = User::select('name', 'littlelink_name', 'littlelink_description')->where('id', $id)->first(); + $information = User::select('name', 'littlelink_name', 'littlelink_description')->where('id', $id)->get(); + + $links = DB::table('links')->join('buttons', 'buttons.id', '=', 'links.button_id')->select('links.link', 'links.id', 'links.button_id', 'links.title', 'buttons.name')->where('user_id', $id)->orderBy('up_link', 'asc')->orderBy('order', 'asc')->get(); + + return view('littlelink', ['userinfo' => $userinfo, 'information' => $information, 'links' => $links, 'littlelink_name' => $littlelink_name]); + } + //Show buttons for add link public function showButtons() { diff --git a/resources/lang/vendor/env-editor/en/env-editor.php b/resources/lang/vendor/env-editor/en/env-editor.php index 1c5e86b..8eb40b1 100644 --- a/resources/lang/vendor/env-editor/en/env-editor.php +++ b/resources/lang/vendor/env-editor/en/env-editor.php @@ -19,7 +19,10 @@ return [ 'currentEnv' => 'Current .env', ], 'currentEnv' => [ - 'title' => 'Current .env file Content', + 'title' => ' + To be able to save values you see here PHP needs to be able to write to your current directory. + Strings with a # in front of them are comments and wont affect anything. +', 'tableTitles' => [ 'key' => 'Key', 'value' => 'Value', diff --git a/routes/web.php b/routes/web.php index 3f55c46..c18ebc0 100755 --- a/routes/web.php +++ b/routes/web.php @@ -17,6 +17,14 @@ use App\Http\Controllers\UserController; | */ +//Changes the homepage to a LittleLink Custom profile if set in the config +if(env('HOME_URL') != '') { + Route::get('/', [UserController::class, 'littlelinkhome'])->name('littlelink'); + Route::get('/home', [App\Http\Controllers\HomeController::class, 'home'])->name('home'); +} else { + Route::get('/', [App\Http\Controllers\HomeController::class, 'home'])->name('home'); +} + //Redirect if no page URL is set Route::get('/@', function () { return redirect('/studio/no_page_name'); @@ -27,7 +35,6 @@ Route::get('/going/{id?}/{link?}', [UserController::class, 'clickNumber'])->wher Route::get('/+{littlelink}', [UserController::class, 'littlelink'])->name('littlelink'); Route::get('/@{littlelink}', [UserController::class, 'littlelink'])->name('littlelink'); Route::get('/pages/{name}', [AdminController::class, 'pages'])->name('pages'); -Route::get('/', [App\Http\Controllers\HomeController::class, 'home'])->name('home'); //User route Route::group([ diff --git a/storage/backups/default_settings b/storage/backups/default_settings index 344e3cc..99e2cc7 100644 --- a/storage/backups/default_settings +++ b/storage/backups/default_settings @@ -8,6 +8,11 @@ NOTIFY_UPDATES=true DISPLAY_FOOTER=true DISPLAY_CREDIT=true +#Home URL=Changes if a user profile should be displayed as the homepage +#=Leave empty to use the default homepage. To set your profile as the homepage, enter a LittleLink name. You can find this on the user panel under the page setting, the name is what comes after the '@'. +#=(e.g. 'admin' without the '@') +HOME_URL= + #App Settings=Changes settings regarding your LittleLink Custom installation. You probably only want to change the App Name setting. #=App_Name changes the displayed name for the App in the title, for example. APP_NAME="LittleLink Custom"