Laravel HOmestead设置但项目未加载

时间:2015-09-11 00:46:38

标签: php laravel virtualbox laravel-routing homestead

页面看起来像这样。项目未加载。

<html><body><h1>It works!</h1></body></html>

路由文件是这样的。登录页面应该在这里。但不确定..? :(

<?php

use Illuminate\Queue\Jobs\SyncJob;

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/

// Ensure SSL for specific URLs
$ssl_urls = [
    'vpass.io'
];
$host = $_SERVER['HTTP_HOST'];
$host_bits = explode('.', $host);


$tld = array_pop($host_bits);
$domain = array_pop($host_bits);

$domain_for_ssl = $domain.'.'.$tld;

if(in_array($domain_for_ssl, $ssl_urls))
{
    URL::forceSchema('https');
}




Route::get('contact-support', 'SubscribersController@getContactSupport');
Route::post('contact-support', 'SubscribersController@postContactSupport');


Route::group(array('before' => 'sentinel_auth'), function() {

    if (Sentinel::check()) {
        $admin_allowed = false; // used to make sure higher admin have access to action of other admins


        // admin level
        if (Sentinel::inRole('system_admin')) {

            $admin_allowed = true;

            Route::controller('admin-reports', 'AdminReportsController');
            Route::controller('admin-reports/system-events', 'AdminReportsController');
            Route::controller('admin-reports/email-queue', 'AdminReportsController');
            Route::controller('admin-reports/terminals', 'AdminReportsController');
            Route::controller('admin-reports/user-visits', 'AdminReportsController');

        }
        // master level

        if ($admin_allowed == true || Sentinel::inRole('master_admin') || Sentinel::inRole('super_admin') || Sentinel::inRole('admin') || Sentinel::inRole('user')) {

            $admin_allowed = true;

            Route::controller('resellers', 'ResellersController');
            Route::controller('reseller-rebates', 'ResellerRebatesController');
        }
        // reseller level
        if ($admin_allowed == true || Sentinel::inRole('reseller_admin')) {

            $admin_allowed = true;

            Route::group(array('before' => 'reseller_permissions'), function() {
                Route::controller('subscribers', 'SubscribersController');
                Route::controller('reseller-account', 'ResellerAccountController');
                Route::controller('reseller-themes', 'ResellerThemesController');
            });

        }

        // subscriber level
        if ($admin_allowed == true || Sentinel::inRole('subscriber_admin') || Sentinel::inRole('super_admin') || Sentinel::inRole('admin') || Sentinel::inRole('user')) {
            Route::group(array('before' => 'subscriber_permissions'), function() {

                    Route::controller('dashboard', 'DashboardController');

                    Route::controller('terminals', 'SubscriberTerminalsController');
                    Route::controller('users', 'SubscriberTerminalUsersController');
                    Route::controller('user-roles',  'SubscriberTerminalUserRolesController');

                    Route::controller('locations', 'SubscriberLocationsController');
                    Route::controller('sites', 'SubscriberSitesController');
                    Route::controller('location-templates', 'SubscriberLocationTemplatesController');
                    Route::controller('forms', 'SubscriberFormsController');
                    Route::controller('themes', 'SubscriberThemesController');
                    Route::controller('reports/user-visits',  'SubscriberTerminalUserVisitsController');
                    Route::controller('reports', 'SubscriberReportsController');

                    Route::controller('my-account', 'SubscriberAccountController');
                    Route::controller('billing', 'SubscriberBillingController');

                    Route::controller('admins', 'SubscriberAdminsController');
                    Route::controller('roles', 'SubscriberRolesController');

                    Route::get('select_template', 'SubscribersController@getSelectTemplate');
                    Route::post('select_template', 'SubscribersController@postSelectTemplate');


                });


        }

        Route::post('pusher/auth', 'PusherAuthController@authenticate');

    }

});



// The API

Route::filter('api_auth', 'Arkade\API\RouteFilter');

Route::group(array('prefix' => 'api/v1','before' => 'api_auth'), function()
{
    Route::resource('configuration', 'ConfigurationController');
    Route::resource('signature', 'SignatureController');
    Route::resource('terminalsettings', 'TerminalSettingsController');
    Route::resource('checkusercode', 'CheckCodeController');
    Route::resource('checkusercodeavailable', 'CheckCodeAvailableController');
    Route::resource('checkidentity', 'CheckIdentityController');
    Route::resource('visit', 'VisitController');
    Route::post('hello', 'HelloTerminalController@hello');
});

Route::resource('api/v1/activate', 'ActivationController');
Route::resource('api/v1/activateuserpass', 'ActivationUserNamePassController');

Route::resource('api/v1/flood', 'FloodTestController'); // TODO remove me once flood testing complete

Route::resource('api/v1/callback', 'ChargifyController');
Route::resource('api/v1/callbacktest', 'ChargifyTestController');



// The non authenticated routes

Route::controller('login',  'LoginController');
Route::controller('signup/{code?}', 'SignupController');
Route::get('logout', 'LoginController@getLogout');
Route::get('override_style.css', 'StyleController@getOverrideStyle');

if (Config::get('app.debug')) {
    Route::get('acceptance/{path}', function ($path) {
        return new \Symfony\Component\HttpFoundation\BinaryFileResponse(storage_path('acceptance/') . $path);
    })->where('path', '.*$');
}

// AMAZON SQS - don't change this route.
// for documentation on how this endpoint should work see http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-tiers.html
Route::post('queue/push', function(){

    ini_set('max_execution_time', 0);

    Log::info(Request::json()->all());

    $job = new SyncJob(
        App::make('app'),
        Request::json('job'),
        json_encode(Request::json('data')
    ));
    $job->fire();

    // Note: SQS will auto-delete the job if this route returns status 200. Response body is ignored.
    // Returning no payload is fine. If the worker class throws an exception, Laravel will return a 500 status and
    // SQS will not delete the job.
});


Route::controller('/', 'LoginController');

而homestead.yaml文件是这样的:

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/www
      to: /home/vagrant/www

sites:
    - map: homestead.app
      to: /home/vagrant/Code/Laravel/public
    - map: vpass.app 
      to: /home/vagrant/www/Code/vpass/public
      hhvm: true

databases:
    - homestead

variables:
    - key: APP_ENV
      value: local

# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

# ports:
#     - send: 93000
#       to: 9300
#     - send: 7777
#       to: 777
#       protocol: udp

0 个答案:

没有答案