Namespacing in Laravel Spark install - laravel-5

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 :)

Related

cannot access Component controller variables inside the component view

I have been running into this very weird issue with Laravel.
I had a problem where one of my component views was not able to read the variables defined in its class. It was kind of strange because I have several components running in my project and they all worked fine, except for this one.
So I created a fresh Laravel project to test some things out (Wanted to check if the problem was on my end, maybe I somehow messed up the project files).
I created a new component on a blank project using php artisan make:component top_nav
pre function basically is used as print_r which is in helper.php
Then I simply added a sql_data variable to the class component like so:
i tried many thing as much as i can do but still i can't access that variable
also clear cache of view
of laravel
change name of components but still can't work
kindly help me..........
you should
return view('components.top_nav', ['sql_data' => $sql_data]);
you are not passing the variable to the view
composer install
npm install && npm run dev
php artisan optimize
I just copied your screenshots into a new laravel installation and ran it with no problems.
Try setting the public property with a default value:
public $sql_data = 'testing'
If you try the above and still have issues, I'd like to confirm the output of AdminLogin::all().
PS:
TopNav instead of top_nav Class name please.

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

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.

Laravel IronMQ class not found exception

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.

codeigniter modular extensions

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);

Resources