Laravel Api Documentation Genarator - laravel

I've installed the composer require mpociot/laravel-apidoc-generator according to what the documentation says.
Also published the config file
Now when I run the php artisan apidoc:generate command
I got the following error, have searched google but din't find anything relevant,
Argument 1 passed to Mpociot\ApiDoc\Tools\DocumentationConfig::__construct() must be of the type array, null given, called in D:\WaheedSindhani\Projects\petApp\vendor\mpociot\laravel-apidoc-generator \src\Commands\GenerateDocumentation.php on line 61

it is a config cache problem
php artisan config:clear has solved the problem'

Related

Laravel ER diagram generator getAllModelsFromEachDirectory()

When I try to follow the instruction here (https://github.com/beyondcode/laravel-er-diagram-generator) I get the following error.
Symfony\Component\Debug\Exception\FatalThrowableError : Argument 1 passed to BeyondCode\ErdGenerator\GenerateDiagramCommand::getAllModelsFromEachDirectory() must be of the type array, null given, called in vendor\beyondcode\laravel-er-diagram-generator\src\GenerateDiagramCommand.php on line 96
at vendor\beyondcode\laravel-er-diagram-generator\src\GenerateDiagramCommand.php:101
97|
98| return $modelsFromDirectories;
99| }
100|
101| protected function getAllModelsFromEachDirectory(array $directories): Collection
102| {
103| return collect($directories)
104| ->map(function ($directory) {
105| return $this->modelFinder->getModelsInDirectory($directory)->all();
Exception trace:
1 BeyondCode\ErdGenerator\GenerateDiagramCommand::getAllModelsFromEachDirectory()
vendor\beyondcode\laravel-er-diagram-generator\src\GenerateDiagramCommand.php:96
2 BeyondCode\ErdGenerator\GenerateDiagramCommand::getModelsThatShouldBeInspected()
vendor\beyondcode\laravel-er-diagram-generator\src\GenerateDiagramCommand.php:57
Please use the argument -v to see more details.
I've already opened an issue in the repository.
Screen capture of the error:
Posting for others that may encounter same issue.
Confirm you are using the latest version 1.4.0 of the library
Also if you're using php artisan serve try to stop the server. Run php artisan config:cache, and restart the artisan sever.
Note that the reason why you might need to run php artisan config:cache is because Laravel does cache the app's configurations. if you changed or added new configurations you might explicitly need to clear the configuration cache so that Laravel can cache the new configurations.
If no solution yet. Try this
php artisan vendor:publish --provider=BeyondCode\\ErdGenerator\\ErdGeneratorServiceProvider.
Then repeat step 2.

Installing Riari/Laravel forum with composer - error - class not found

I am trying to install Riari forum for Laravel and I follow strictly the steps from http://teamteatime.net/docs/laravel-forum/3.x/installation.md
When I type php artisan vendor:publish in the console, it gives me this error:
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Riari\Forum\ForumServiceProvider' not found
How can I fix it?
You need to put this (Riari\Forum\ForumServiceProvider) in Config/app.php inside service provider in the same format where already some providers are added

Exception: trim epects parameter 1 to be string, array given

Hello i recently tried to implement JWT authentication in my app by following this tutorial i found online:
cookie-free-authentication-with-json-web-tokens-an-example-in-laravel-and-angularjs
However when trying to install the following package:
barryvdh/laravel-cors 0.4.x#dev
I got an error exception when trying to run php artisan clear-compiled
and later when i tried to run php artisan vendor:publish
This is the error:
[ErrorException]
trim() expects parameter 1 to be string, array given
Edit: I just removed the package and tried running composer update, had the same error again.
Okay i found the error, it had to do with my routes file:
Route::any(['{url?}'], function($url) {
return view('website/index');
})->where(['url' => '[-a-zA-Z0-9/]+']);
I removed the square brackets and now it works, must have accidentally put it there:
Route::any('{url?}', function($url) {
return view('website/index');
})->where(['url' => '[-a-zA-Z0-9/]+']);
Not gonna delete though, somebody might find this useful lol xD xD

Laravel 4 - unserialize(): Error at offset 0 of 32 bytes

When I install Laravel 4, I receive this error:
ErrorException
unserialize(): Error at offset 0 of 32 bytes
C:\xampp\htdocs\blog\laravel\bootstrap\compiled.php
return unserialize($this->stripPadding($this->mcryptDecrypt($value, $iv)));
If I modify return like this:
return unserialize(base64_decode($this->stripPadding($this->mcryptDecrypt($value, $iv))));
Then the error goes away. But of course every time I run composer update this change will be undone.
What could be the reason of this problem?
I appreciate any help.
Update: This only happens when I use Auth::check().
Update 2: Now it only works with base64_decode() removed. It's like if the xampp installation has become self-aware. Jesus!
Refer to this issue: laravel/framework#1526
A change in the encryption mechanism is the cause. My solution was to empty out the sessions and views that were cached in the storage folder, then run php artisan key:generate and relaunch the server. I'm not sure which part of the process fixed the issue, but I haven't seen it since.
The command > php artisan cache:clear fixed the problem for me.
I did not have to restart the server
Can you post what you're doing that causes this error? You shouldn't be modifying the core - because as you said, updates will overwrite it.
You have to set a news Key, use the following command:
php artisan key:generate
After that test again to run the Laravel Application
php artisan serve

symfony cmf doctrine phpcr migrator page variable

im following the symfony cmf tutorial, i setup an mysql connection instead of sql_light. i setup the database, but now im trying to add the the page with the command from the tutorial:
php app/console doctrine:phpcr:migrator page --identifier=/cms/simple/test
but this gives the following error
[InvalidArgumentException]
Wrong value 'page' for migrator_name argument.
Available migrators:
doctrine:phpcr:migrator:migrate [--identifier[="..."]] [--depth[="..."]] [--session[="..."]] [migrator_name]
What do i do wrong?
just want to share my experience.
Symfony-cmf-standard
follow tutorial there.
before following this command
app/console doctrine:database:create
app/console doctrine:phpcr:init:dbal
app/console doctrine:phpcr:register-system-node-types
app/console doctrine:phpcr:fixtures:load
change you db configuration bia web/config.php or parameters.yml
on windows,
app/console doctrine:phpcr:fixtures:load
may fail, you can follow this link windows fix
good luck,

Resources