-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not work in Lumen / Laravel #31
Comments
I haven't tested this package in Lumen. I made it for Laravel. I believe we only need the Service Provider for Lumen 🤔 |
The package has problems in Lumen, does not have the function "config_path ()" for example and gives an error also in the command line, it was the tests that I performe!!! |
You can follow these instructions to add config_path to Lumen: https://gist.github.com/mabasic/21d13eab12462e596120 However, now I'm stuck at
I ran the following:
The config/models.php file exists and is exactly the same as the one found here: |
Try clearing the config cache |
I tried that, but that command is not available in Lumen unfortunately. There's nothing in the storage/cache directory either. |
Try looking at |
Unfortunately the package is not compatible |
Here's my workaround: I installed laravel and pointed it to my database. Then I installed and ran this package so I could generate the model files. I copied the model files over to my lumen project but I had to change a few things: In the generated model files i switched |
You can do that by changing this package's config file 😄 so you don't have to do it manually. The file |
I had same issue. The problem is, config file not loading... put your
If i'm not wrong lumen does not load config files automatically. So you have to load it :) |
I have this problem :( [ErrorException] |
Same problem: php artisan code:models --table="ipb2_mod_newsroom_forums_exclusive"
ErrorException : mkdir(): Invalid path
at /Users/approach/workspace/IALaravel/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:492
488| if ($force) {
489| return @mkdir($path, $mode, $recursive);
490| }
491|
> 492| return mkdir($path, $mode, $recursive);
493| }
494|
495| /**
496| * Move a directory.
Exception trace:
1 mkdir("")
/Users/approach/workspace/IALaravel/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:492
2 Illuminate\Filesystem\Filesystem::makeDirectory("")
/Users/approach/workspace/IALaravel/vendor/reliese/laravel/src/Coders/Model/Factory.php:482
Please use the argument -v to see more details. |
You've probably forgotten to publish the configurations. In case you are using Lumen, remember to register the appropriate configuration within your |
I've had some problems with some functions that were missing (app_path & config_path). These steps fixed it for me:
user@local lumen % mkdir config
user@local lumen % cp vendor/reliese/laravel/config/models.php config
// ...
$app->configure('models');
if ($app->environment() == 'local') {
$app->register(\Reliese\Coders\CodersServiceProvider::class);
}
// ...
{
// ...
"autoload-dev": {
"files": [
"laravel-functions.php"
]
},
// ... other entries
}
<?php
if (!function_exists('app_path')){
function app_path($path = ''){
return base_path('app' . DIRECTORY_SEPARATOR . ltrim($path, '/'));
}
}
if (!function_exists('config_path')){
function config_path($path = ''){
return base_path('config' . DIRECTORY_SEPARATOR . ltrim($path, '/'));
}
}
The separate file here can have any name, obviously. |
Nice tips! Thanx @tweichart |
Does not work in Lumen / Laravel ???
The text was updated successfully, but these errors were encountered: