Closed tsiedsma closed 9 years ago
Hi,
Can you run this command in your terminal ?
php artisan env
It should not output production
, can you check this ?
And you need to enable debug
mode in your local
or development
environment.
Create or edit the file app/config/local/app.php
:
<?php
return [
'debug' => true,
// Others config options....
];
See also #5
Current application environment: local
Debug is set to true in my app/config/local/app.php
Can you try to create or edit this file app/config/app.php
:
<?php
return [
'debug' => true,
// Others config options....
];
The issue is here.
This code doesn't seem to work with local
env:
$this->app['config']->get('app.debug')
I need to find a way to read the debug
config option in other env than production
...
Thank you, setting debug true in production app.php did the trick.
I have another question. My local server is on vagrant and uses apache, when larasset generates links to assets, it uses localhost:3000, is there a way to have it use the real url and port like the rest of laravel? I'm not running the artisan server...
<link media="all" type="text/css" rel="stylesheet" href="http://localhost:3000/assets/application.css">
Should Be:
<link media="all" type="text/css" rel="stylesheet" href="http://localhost:8080/assets/application.css">
If your application is in production
mode and your assets are precompiled it should be OK.
It's my local dev instance, it's in local mode. I need to be able to work on my local dev instance and have the links generate properly.
http://localhost:3000/assets/application.css is a 404, that port doesn't exist and is not forwarded through vagrant.
You can set this env variable : ASSETS_ENV=local
I can confirm that works, thank you for your prompt help!
OK, I reopen this issue because of the local
debug config option bug.
The commit 8559325 fix this issue.
So the --environment
command line option is renamed to --assets-env
. and larasset-environment
command line option is renamed to --larasset-env
.
So don't forget to change your build script :smile:
I've been testing your package and have run into an issue in my local and development environments. Both systems produce the exact same error when trying to pre-compile assets for production use.
$ php artisan larasset:precompile --environment production
[InvalidArgumentException] There are no commands defined in the "larasset" namespace.
Running the same command without the environment option does a successful pre-compile but does not minify or compress anything.
laravel.log entry: