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
Related
I just installed CodeIgniter 4, configured the .env file to "development" and did also set the base url. For some strange reason, when I load a controller I get this error concernig the CI debug bar:
How can I solve this error?
Thanks!
You can try by removing 3rd party js plugins. In my case Paypals checkout.js is causing the issue when ci4 is in development environment. It will be gone when you switch to production
This Answer maybe too late. But I just want to inform to some poeple that have an issue like this. So in my trouble, I just remove some js in my apps. It's work for me.
I didn't change any backend code .I dont know it triggers when I hit any url of laravel app it will show this error.I dont know why this happend and also need solution for this .My laravel version in 5.8 and php 7.2
Fatal error : Class Illuminate\Routing\RouteCollection contains 1 abstract method and must therefore be declared abstract or implement the remaining methods C:\xampp\htdocs\pmf\vendor\laravel\framework\src\Illuminate\Routing\RouteCollection.php on line 14 this is file it is saying.
Reinstall or update composer wont solve the problem. In my case, you just need to restart the local development server, because the problem is just temporary.
Just need to restart the local development server.
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.
I am haveing trouble with getting a cron job to work with codeigniter
I have used these instructions.
https://www.codeigniter.com/user_guide/general/cli.html
But it is not working
Here is what I have.
php /home4/markwolf/public_html/propalert.asia/index.php admin_notifications index
But it is not finding the right controller or the method, instead it is going to the "default_controler". Everything else I've tried gets a 404 not found error.
I've been pulling my hair out for two days trying to get this to work so any help would be greatly appreciated.
Thanks
EDIT
This works:
wget -q http://propalert.asia/admin_notifications
But the problem with this method is that Codeigniter's method for protecting the script by checking whether it is accessed by cli returns false.
I came across this post at CI's forum describing the same problem.
https://ellislab.com/forums/viewthread/236475/#1055830
Unfortunately he never got an answer there either.
I finally found the solution:
/usr/bin/php-cli -q /home4/markwolf/public_html/propalert.asia/index.php admin_notifications index
the key is "php-cli" instead of "php".
But then there is a bug in the CI core that needs to be fixed. You can find the solution to that here:
https://ellislab.com/forums/viewthread/227672/
I'm trying to implement modular extensions into a codeigniter 2 setup but am having a few problems. I followed the installation instructions on the wiki and everything was working fine. Then I started to play around a bit and try and use it. All I did was create a new module called users with the required folders and added a model class called users_m. I then tried to load this from my welcome module controller. According to the wiki this should be very straightforward. I simply added this line
$this->load->model('users/users_m');
to the constructor of my welcome controller.
Unfortunately at this point I get the white screen of death.
So I tried something else. This time I removed the load model line and added
$this->output->enable_profiler(TRUE);
This time I got the welcome page displayed and I got the profiler, but at the top of the page I got this error:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI::$profiler
Filename: MX/Loader.php
Line Number: 145
I don't know if these two tries are related or not, but there's obviously something not right with my setup. Could someone point me in the right direction?
If you accessing the model from the controller in the same module, you can load it using just:
$this->load->model(‘user_m’);
You only have to do $this->load->model(‘module/model_name’); when your cross loading between modules.
Just to make sure, your model is located here right?
application/modules/users/models/users_m.php
As for the profiler error:
1) Have you done installation step 5 and put the Modular Extensions core files into application/core?
2) Do you have the latest version of HMVC? There have been updates to mx/loader.php in the last couple days.
Ps. great tutorial on HMVC: http://net.tutsplus.com/tutorials/php/hvmc-an-introduction-and-application/
if you have folder structure like:
application/
modules/
users/
models/
users_m.php
then use this to call modelsin you controller
$this->load->model('users/users_m','',TRUE);