36 lines
766 B
PHP
36 lines
766 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
/**
|
|
* 靜態頁面的controller
|
|
*
|
|
* Class PageController
|
|
* @package App\Http\Controllers
|
|
*/
|
|
class PageController extends Controller
|
|
{
|
|
public function index()
|
|
{
|
|
return view('index');
|
|
}
|
|
|
|
/**
|
|
* Robots.txt
|
|
*
|
|
* @param Request $request
|
|
* @return \Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Http\Response
|
|
*/
|
|
public function robotstxt(Request $request)
|
|
{
|
|
if(app('Option')->block_search_indexing) {
|
|
$content = view('components.robotsTxt.disallowAll');
|
|
} else {
|
|
$content = view('components.robotsTxt.default');
|
|
}
|
|
return response($content)->header('Content-type', 'text/plain');
|
|
}
|
|
}
|