I'm using L5(dev version) and trying to create package.
Doing `php artisan workbench za-web/Sidebar --resources
It's creating for me structure and service provider.
And then I'm trying to add service provider to app/config.php
'ZaWeb\Sidebar\SidebarServiceProvider'
I've got the error:
Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_ERROR)
Class 'ZaWeb\Sidebar\SidebarServiceProvider' not found
Also was trying to do composer dump-autoload but it doesn't helped.
I've figured out whats wrong, theres no autoload seciton for workmench directory in bootstrap/autoload.php
I've add it and not everything ok.
if (is_dir($workbench = __DIR__.'/../workbench'))
{
Illuminate\Workbench\Starter::start($workbench);
}
Related
I just cloned a git repo and ran the necessary commands to install the project.
When I access the login page "http://localhost:80/nova/login" it works. However after enter the correct credentials and submit it shows an error:
Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Class '\App\User' not found
Do you know what can be the issue?
Also running this command:
/var/www # php artisan component:update
It shows a similar error:
Starting Update of All Component files
Symfony\Component\Debug\Exception\FatalThrowableError : Class 'App\Component' not found
After cloning, running through these steps should fix your problem:
run composer install or npm install.
check that the .env file is correct.
run php artisan key:generate
Optional: php artisan migrate
run php artisan serve
Reload composer autloaded classes.
composer dump-autoload
I have Symfony 3.1 project with Doctrine and
doctrine/doctrine-fixtures-bundle and
doctrine/data-fixtures installed.
However, when i run a console command
php bin/console doctrine:fixtures:load
i get a message saying that there are no commands defined in the doctrine:fixtures namespace.
The class Doctrine\Bundle\FixturesBundle\Command\LoadDataFixturesDoctrineCommand exists.
Please suggest how to fix that.
Run first php bin/console and see if the command appear in the list.
If it doesn't, then you have to load the bundle in the AppKernel.php
$bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
php bin/console default environment is PROD
and fixtures proper installation is require-dev
so proper function call is:
php bin/console --env=dev doctrine:fixtures:load
Also rm -rf var/cache worked for me (after the bundle registration)
Data Fixtures Mechanism requires a special bundle. It is not included in Sf by default.
Check: http://symfony.com/doc/current/bundles/DoctrineFixturesBundle/index.html
and install it.
Bundle called DoctrineFixturesBundle. You can also find there many useful information how to use fixtures.
So that why you've got message "Command is not defined".
return Redirect::to('')
->with('message',SiteHelpers::alert('success','Password has been saved!'));
I am getting error in above line saying that
Symfony \ Component \ Debug \ Exception \ FatalErrorException
(E_UNKNOWN)
Class 'SiteHelpers' not found
I kept SiteHelper.php in this path /var/www/html/login_session/app/library
I added "app/library" in my composer.json and run composer install in my terminal
"Class ModelName not found", "Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_ERROR)" is showing while using ModelName::find(1) in the controller which have a namespace of Controllers\admin and model is without any namespace. on the top of file, i applied use ModelName;. after following many guides, i applied php composer dump-autoload and composer du.
still shows model not found. what is the reason and how to use ModelName using Eloquont ?
My application was ok until I changed migrations and update composer. Now it returns an error like this:
Symfony \ Component \ Debug \ Exception \ FatalErrorException
Call to undefined method Package::with()
The Package model was ok before update process. I updated the system yesterday and now almost every modal returns error like above. What happened and what is wrong with new composer?
Are you using a dev version in your composer.json file? Did you list all the facades correctly in the app.php files in all your environments? Did you try a fresh composer dump-autoload? Did you try a new composer update to see if the bug has been fixed by now?
Ok I found the problem. Somehow php artisan migration:make command has created migrations with the same name of modals. I changed the class names of migrations and it works now.