Last active
October 11, 2018 17:45
-
-
Save filljoyner/cc1395e164578bc3c038a4eb8a192705 to your computer and use it in GitHub Desktop.
Laravel - Change Public Directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Replace Application instance with below | |
// Override public directory with custom application instance | |
$app = new \App\Abilities\App\Application( | |
realpath(__DIR__.'/../') | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Abilities\App; | |
class Application extends \Illuminate\Foundation\Application | |
{ | |
public function publicPath() | |
{ | |
return $this->basePath.DIRECTORY_SEPARATOR.'content'; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($uri !== '/' && file_exists(__DIR__.'/content'.$uri)) { | |
return false; | |
} | |
require_once __DIR__.'/content/index.php'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment