Wait, have you moving everything from /public into your root?
Is It Possible to set Different Assets Directory
As a default Laravel looking into public folder to load css files. Thats fine. What about if I move public folder to up directory (not subdirectory anymore ) because of share hosting reason. Example :
MyApp (Laravel App)
Public_html (Public Files, css images, js etc)
In this case Laravel still looking for a public folder inside MyApp! Therefore I cant load css files! With L4 I was able to that. Could someone help me with this pls?
As a summary
Here What I done after fresh Install of Laravel 5.1
|_ Main-app
|_ app
|_ bootstrap
|_ ...
|_ Public_html
|_app
|_index.php
|_css
|_master.css
1.Create MyApp.php class inside Laravel>App folder to extend Applicaton.php class
<? php
namespace App;
class MyApp extends \Illuminate\Foundation\Application
{
public function publicPath()
{
return $this->basePath.DIRECTORY_SEPARATOR.'/../public_html/app';
}
}
2.Inside bootsrap/app use own class
comment old one
// $app = new Illuminate\Foundation\Application(
// realpath(__DIR__.'/../')
// );
$app = new App\MyApp(
realpath(__DIR__.'/../')
);
3.Make changes inside server.php to target index.php
require_once __DIR__.'/../public_html/app/index.php';
4.Make changes inside index.php
require __DIR__.'/../../main-app/bootstrap/autoload.php';
and
$app = require_once __DIR__.'/../../main-app/bootstrap/app.php';
DONE my app working but not loading css or img
Please or to participate in this conversation.