2016-07-21 22:01:57 +08:00
|
|
|
<?php
|
|
|
|
|
2016-08-28 10:05:21 +08:00
|
|
|
namespace App\Http\Controllers;
|
2016-07-21 22:01:57 +08:00
|
|
|
|
2020-05-18 16:40:31 +08:00
|
|
|
use App\Services\Webpack;
|
2019-09-18 23:06:48 +08:00
|
|
|
use Illuminate\Support\Arr;
|
|
|
|
|
2016-09-04 15:35:12 +08:00
|
|
|
class HomeController extends Controller
|
2016-07-21 22:01:57 +08:00
|
|
|
{
|
2020-05-18 16:40:31 +08:00
|
|
|
public function index(Webpack $webpack)
|
2016-07-21 22:01:57 +08:00
|
|
|
{
|
2019-12-14 23:17:44 +08:00
|
|
|
return view('home')
|
|
|
|
->with('user', auth()->user())
|
2019-09-18 23:06:48 +08:00
|
|
|
->with('site_description', option_localized('site_description'))
|
|
|
|
->with('transparent_navbar', (bool) option('transparent_navbar', false))
|
|
|
|
->with('fixed_bg', option('fixed_bg'))
|
|
|
|
->with('hide_intro', option('hide_intro'))
|
|
|
|
->with('home_pic_url', option('home_pic_url') ?: config('options.home_pic_url'))
|
2020-05-18 16:40:31 +08:00
|
|
|
->with('home_page_css', $webpack->url('home.css'))
|
|
|
|
->with(
|
|
|
|
'home_page_css_loader',
|
|
|
|
config('app.asset.env') === 'development' ? $webpack->url('home.js') : null
|
|
|
|
)
|
2019-09-18 23:06:48 +08:00
|
|
|
->with('user_can_register', option('user_can_register'));
|
2016-07-21 22:01:57 +08:00
|
|
|
}
|
2019-05-01 10:14:14 +08:00
|
|
|
|
|
|
|
public function apiRoot()
|
|
|
|
{
|
2019-09-18 23:06:48 +08:00
|
|
|
$copyright = Arr::get(
|
|
|
|
[
|
|
|
|
'Powered with ❤ by Blessing Skin Server.',
|
|
|
|
'Powered by Blessing Skin Server.',
|
|
|
|
'Proudly powered by Blessing Skin Server.',
|
|
|
|
'由 Blessing Skin Server 强力驱动。',
|
|
|
|
'自豪地采用 Blessing Skin Server。',
|
|
|
|
],
|
|
|
|
option_localized('copyright_prefer', 0)
|
|
|
|
);
|
|
|
|
|
2019-05-01 10:14:14 +08:00
|
|
|
return response()->json([
|
|
|
|
'blessing_skin' => config('app.version'),
|
|
|
|
'spec' => 0,
|
2019-09-18 23:06:48 +08:00
|
|
|
'copyright' => $copyright,
|
2019-05-01 10:14:14 +08:00
|
|
|
'site_name' => option('site_name'),
|
|
|
|
]);
|
|
|
|
}
|
2016-07-21 22:01:57 +08:00
|
|
|
}
|