Laravel's ui:auth command generating incompatible Controllers - laravel

I have a Laravel installation on v7.29.3 (our server won't support v8 yet)
I am having an issue with the ui:auth command. It is generating Controllers that reference classes in the Illuminate namespace that don't exist.
For example, the Auth\VerificationController class it gives me, uses Illuminate\Foundation\Auth\VerifiesEmails but I can't see a corresponding file in the /vendor/laravel/src/Illuminate/Foundation/Auth directory.
What's more, when I search for "VerifiesEmails" in the Laravel API doc for v7.x there is no such file. This file does exist however when I search for it in v6.x
So my guess is that I've got a mismatch somewhere and I'm getting v6 controllers for a v7 installation.
However, composer is showing that I have laravel/ui 2.5 which is supposed to be for Laravel 7.
I've tried deleting my composer.lock and vendor directories and reinstalling from composer in the hope that would clear up the issue, but no dice.
Any ideas what could be going on?

Those classes aren't in vendor/laravel/framework/src/.... They are not part of the framework. They come from the laravel/ui package, vendor/laravel/ui/auth-backend/....

Related

Hesitate to remove utility in my laravel 5.5 project

How about, some time ago I had installed this utility to monitor the query results in my application, now I want to remove it, but I do not know how, someone knows how I can deactivate it?
Welcome to StackOverflow!
That bar at the bottom is called the Laravel Debugbar which is found here: https://github.com/barryvdh/laravel-debugbar
It is controlled by a setting in your .env file in the root of your project called APP_DEBUG. Set this to false to hide the bar (recommended for production).
To uninstall it from your project completely, run composer remove barryvdh/laravel-debugbar. Depending on your Laravel version, you may also have to remove the Service Provider from config/app.php (under providers) or remove it from app/Providers/AppServiceProvider.php depending how you originally installed it.
Note: If you're caching your config (by using php artisan config:cache) then don't forget to clear your config cache after changes by running php artisan config:clear.

Using the Google Analytics PHP Client Library in Laravel

I am fairly new to Laravel and am trying to integrate the Google Analytics PHP Client Library (https://developers.google.com/analytics/devguides/reporting/core/v3/quickstart/service-php) in an application I am building.
According to the documentation , the library needs to be installed via Composer and then loaded using:
require_once __DIR__ . '/vendor/autoload.php';
In the vendors folder, I can see that there is a folder named google. So my question is, what would be the correct way to load this library in Laravel? Would it be using the code shown above, or some other method?
Thanks
The autoload.php file is already required by your laravel app, you should be able to access it by it's namespace after running composer dump-autoload as suggested by Ayaz.
You may want to look at a package like https://github.com/spatie/laravel-analytics where they've done the work to integrate the google analytics api into Laravel a bit more. Even if you don't use it I'm sure you can glean some good info from checking out the source files.
According to the documentation , the library needs to be installed via Composer and then loaded
You can do it by executing following command in your git bash or cmd
$ composer dump-autoload

Class not found despite composer dump autoload

Good day,
I am getting a class not found error on our website.
Class 'BootForm' not found
However when I checked the vendor directory, the files are there.
So I ran this command.
php artisan version
The site that uses the same dependency was this version.
Laravel Framework 5.5.23
The site that is not working was this version.
Laravel Framework 5.4.35
And when I check the files, the working site had this file.
bootstrap/cache/packages.php
Does that mean that I have to update the laravel version?
In laravel 5.5, a new feature was add called Package discovery
https://laravel.com/docs/5.5/packages#package-discovery
In laravel 5.4 you have to add your providers array located in the config/app.php file
that''s why you got an error on your 5.4 version and not in the 5.5 one :)

Laravel 4.2 view:publish from custom location

I'm currently developing a package in L4.2 but I'm not using the workbench I have a complete custom structure.
But now I'm facing the problem that when I execute the artisan command view:publish I get the following error:
[InvalidArgumentException]
Views not found.
It seems like I have to give Laravel the location of my views but I can't find how to do this, so I hope anybody could help me.
My views are located at: vendor/package/src/views
My service provider at: vendor/package/src/serviceprovider.php
I also tried to use php artisan view:publish vendor/package --path="src/views" but no luck so far.
I hope somebody can help me,
Thanks,
Joren
php artisan view:publish td/longstack --path="packages/vendorname/packagename/src/views/"
Never mind I forgot to specify the folder where alle my packages are located. It works now.

Basic Codeigniter HMVC Installation

I have a existing working installation of CI 2.02 that autoloads libraries and helpers. When I perform the HMVC installation by dropping the core and 3rd party files into their respective locations in the CI directory, I get the error
Fatal error: Cannot access empty property in C:\xampp\htdocs\APPNAME\application\third_party\MX\Loader.php on line 208
When I remove all helpers from application/config/autoload.php, i get
An Error Was Encountered
Unable to load the requested file: helpers/_helper.php
When I use a clean CI installation with no libraries or helpers autoloading, it works fine. What should I do to get HMVC and autoloading to work?
I installed HMVC by following the instructions on their website (https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/wiki/Home). I only did Step 15 and doing Step 6 shows the error I mentioned earlier. I have a single controller file in /application/controllers, a single model file in /application/models and a single view file in /application/views which I move to /application/modules/site/controllers, /application/modules/site/models and /application/modules/site/views respectively. I left the config.php, autoload.php anad database.php as they are in the application folder.
Before installing HMVC (performing Steps 1-6 from their website), I already have a existing CI project. I am autoloading some libraries and helpers (database, session, file, url, forms, text) using application/config/autoload.php.
Is there any more info that I need to show to figure out where the problem lies in? This is my first CI project so its nothing fancy. Thanks!
Upgrade to 2.0.3 and the latest version of HMVC, it should work fine.

Resources