Laravel IronMQ class not found exception - laravel

I am trying to push new queue using iron.io and Laravel queues.
Upon deploy I got this message:
Class 'IronMQ' not found
But,there is no class with that name - there is IronMQ_Message class in iron.io package. That package is very simple, and it is not so hard to take a peak inside, but I wonder am I missing something ? Maybe some recent fixes, because I am using it for the first time ? Anybody had that issue ?
Thanks

You need to add
"iron-io/iron_mq": "dev-master"
To your composer.json.
Then delete your vendor folder, your composer.lock and
composer install
Again. Sometimes we get those errors with Iron.

Related

Did I solve my "Target class [mail.manager] does not exist." issue?

Just upgraded from Laravel 6 to 7, and had the error response above when submitting a contact form. I eventually found a solution that seems to work and I am submitting here to help out the next guy.
In the terminal run:
composer require illuminate/mail
Add the following to the top of the controller file (app/Http/Controllers/Main.php in my case):
use \Illuminate\Support\Facades\Mail;
Add this to bootstrap/app.php:
$app->register(Illuminate\Mail\MailServiceProvider::class);
Save and test, and it worked localhost.
If the above does not work for you, there are some other possible issues and solutions available at this link, where I must give credit to vipindasks.
https://laracasts.com/discuss/channels/lumen/lumen-52-mail-not-working
Since I am suppose to ask a question:
Do you see any problems with this solution even though the site and mailer is working now?
You are simply missing a backslash. This tells the autoloader that the file you are looking for is not in the namespace your controller resides in :
$app->register(\Illuminate\Mail\MailServiceProvider::class);
Run composer update hope this will help you

Laravel can't see existing vendor class after update

I am no longer able to send email from my Laravel app once I updated to v6.10, 6.11. I have not changed any code, nor have I required or removed anything new from composer recently. This appears to be potentially something with the new build of Laravel, as this exact code is functional and sending email on v6.7 and below.
Error msg:
Class 'League\CommonMark\Environment' not found (View: /home/ww/app/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/footer.blade.php)
{"exception":"[object] (Facade\Ignition\Exceptions\ViewException(code:
0): Class 'League\CommonMark\Environment' not found (View:
/home/ww/app/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/footer.blade.php)
at
/home/videocyp/app/vendor/laravel/framework/src/Illuminate/Mail/Markdown.php:103)
The line from my footer from my published vendor file that is causing the issue:
{{ Illuminate\Mail\Markdown::parse($slot) }}
Inside the vendor file Markdown.php
use League\CommonMark\Environment;
class Markdown
{
public static function parse($text)
{
$environment = Environment::createCommonMarkEnvironment();
// etc...
}
Looking at League\CommonMark\Environment, I find the class (as does my IDE):
final class Environment implements EnvironmentInterface, ConfigurableEnvironmentInterface { }
I'm beyond my level of understanding here as to why Laravel is unable to see one of its vendor classes.
Anyone able to help?
Turns out this is the result of a significant (slightly breaking) change made to the Laravel build as of v6.10.
Due to a potential XSS vulnerability, it looks like they changed the root parser to League CommonMark. This is causing other issues with existing email published templates due to excess white space being parsed differently in the new CommonMark parser. Bugs are reported here, here, here.
My particular problem was extremely strange, but it is being reported elsewhere in addition to those reported back to Laravel. It was not consistent across my servers, but a complete rebuild (vagrant) solved the issue.
For the others with their previously published email templates showing raw HTML, a re-publish may resolve the issue if lucky and no changes were made to the templates.
Run the following to regenerate the list of all classes that need to be included in your project.
php artisan clear-compiled -o
composer dump-autoload
If still not working, maybe try reinstalling the package.
composer require league/commonmark
What version of Laravel did you upgrade from? Laravel 6.7?

Class 'ConsoleTVs\Charts\ChartsServiceProvider' not found

I want to put a pie chart on my laravel project and install a library consoleTvs. But I decided to remove it from composer since I use a jquery instead.
When i try to run my project I use to have a error message
Class 'ConsoleTVs\Charts\ChartsServiceProvider' not found.
Without seeing ANY code it's very hard to help you.
I try to guess: you are not importing ChartsServiceProvider class so, still guessing, you can put at the start of your file
use App\Providers\ChartsServiceProvider;
So now you want to remove a library from composer.
i hope you remove it correctly. still you can follow below how to remove.
so remove that library code into your composer.json. and hit composer update.
so Hope you remove it correctly, so after removal you facing error of provider.
I guess on the time of installing you manually add a provider into your app.php file inside config folder.
So if, Am right, just go to your app.php file inside config folder and remove that provider as well as its alias too if you give it before.

Composer update not working because of a missing class in config/app.php?

Something strange happened to me today : a collegue changed something in config/app.php , so that a different class is used as a service provider instead of the original one.
The code for this new class is in a package that was added to composer.json.
I updated from SVN and got both new files, but then composer update didn't work, because this somehow uses the config/app.php , which was broken, because it didn't know the class, which of course would only be in vendor AFTER composer update !
So my question is : why would composer update need anything that is in config/app.php ? And how to prevent something like this in the future?
Go to your config/app.php file and comment out the provider which was added by your colleague. Run composer update and then uncomment it, maybe php artisan optimize too and then you should be good to go.
EDIT: When a new package has been added by someone else, you need to install it. You only need to run composer update when you want to update all of your packages to their latest versions, or the framework.

Namespacing in Laravel Spark install

I am trying to install Laravel Spark into an existing app. I have not changed the default namespace of "App".
I get the following error on install:
Class 'Laravel\Spark\Providers\SparkServiceProvider' not found
How can get around this error?
It means you didnt attach a class for laravel to detect it ..
Go to App/Config..open app.php..
scroll down.. youll see a providers list.. add a new line to it like
Laravel\Spark\Providers\SparkServiceProvider::class,
Save and Try again :)

Resources