获取语​​法错误,意外的应用程序' (T_STRING)

时间:2017-06-27 07:42:26

标签: laravel-5

刚刚创建了新的laravel(5.4)项目,上传到共享主机

显示以下错误

 (1/1) FatalErrorException

syntax error, unexpected 'App' (T_STRING)
in HomeController.php (line 1)

这背后的原因是什么,为什么它在单词App中显示错误,我认为它的默认命名空间名称对吗? ,在当地工作得很好(WIN 10,XAMPP)

请帮忙!

HomeController.php的代码非常庞大......仍然发布前几行

namespace App\Http\Controllers;

use App\Coupon;
use App\Footer;
use App\Home;
use App\Http\Models;
use App\Merchant;
use App\Register;
use App\Settings;
use DB;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Validator;
use MyPayPal;
use Session;

class HomeController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Default Home Controller
    |--------------------------------------------------------------------------
    |
    | You may wish to use controllers instead of, or in addition to, Closure
    | based routes. That's great! Here is an example controller method to
    | get you started. To route to this controller, just add the route:
    |
    |   Route::get('/', 'HomeController@showWelcome');
    |
    */
    public function siteadmin()
    {
        return Redirect::to('siteadmin');
    }

    public function index()
    {
        $city_details = Register::getCityDetails();
        $header_category = Home::getHeaderCategory();
        $product_details = Home::getProductDetails();
        $women_product = Home::getWomenProduct();
        $most_visited_product = Home::getMostVisitedProduct();
        $deals_details = Home::getDealsDetails();
        $auction_details = Home::getAuctionDetails();
        $get_product_details_by_cat = Home::getProductDetailsByCategory($header_category);
        $category_count = Home::getCategoryCount($header_category);
        $get_product_details_typeahed = Home::getProductDetailsTypeahed();
        $main_category = Home::getHeaderCategory();
        $sub_main_category = Home::getSubMainCategory($main_category);
        $second_main_category = Home::getSecondMainCategory($main_category, $sub_main_category);
        $second_sub_main_category = Home::getSecondSubMainCategory();
        $get_social_media_url = Home::getSocialMediaUrl();
        $cms_page_title = Home::getCmsPageTitle();
        $country_details = Register::getCountryDetails();
        $addetails = Home::getAdDetails();
        $noimagedetails = Home::getNoimageDetails();
        $getbannerimagedetails = Home::getbannerimagedetails();
        $getmetadetails = Home::getmetadetails();
        $getlogodetails = Home::getlogodetails();
        $get_contact_det = Footer::getContactDetails();
        $getanl = Settings::social_media_settings();
        $general = Home::getGeneralSettings();
        if (Session::has('customerid')) {
            $navbar = view('includes.loginnavbar')->with('country_details', $country_details)->with('metadetails', $getmetadetails)->with('general', $general);
        } else {
            $navbar = view('includes.navbar')->with('country_details', $country_details)->with('metadetails', $getmetadetails)->with('general', $general);
        }
        $header = view('includes.header')->with('header_category', $header_category)->with('logodetails', $getlogodetails);
        $footer = view('includes.footer')->with('cms_page_title', $cms_page_title)->with('get_social_media_url', $get_social_media_url)->with('get_contact_det', $get_contact_det)->with('getanl', $getanl);
        return view('index')->with('navbar', $navbar)->with('header', $header)->with('footer', $footer)->with('header_category', $header_category)->with('product_details', $product_details)->with('deals_details', $deals_details)->with('auction_details', $auction_details)->with('get_product_details_by_cat', $get_product_details_by_cat)->with('most_visited_product', $most_visited_product)->with('category_count', $category_count)->with('get_product_details_typeahed', $get_product_details_typeahed)->with('main_category', $main_category)->with('sub_main_category', $sub_main_category)->with('second_main_category', $second_main_category)->with('second_sub_main_category', $second_sub_main_category)->with('addetails', $addetails)->with('noimagedetails', $noimagedetails)->with('bannerimagedetails', $getbannerimagedetails)->with('metadetails', $getmetadetails)->with('women_product', $women_product)->with('get_contact_det', $get_contact_det)->with('general', $general);
    }

0 个答案:

没有答案