laravel laravelLTE installation issue - php

I followed the following instructions:
First, I ran:
composer create-project --prefer-dist laravel/laravel laravelLTE
cd laravelLTE
php artisan migrate
...which results in the following error:
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'App\Providers\Schema' not found
Then, I modified laravel/app/Providers/AppServiceProvider.php and retried php artisan migrate, but I see the same error as above.
Next, I tried installing the LTE admin template package:
composer global require "acacha/admin-lte-template-laravel:4.*"
...and then added: Acacha\AdminLTETemplateLaravel\Providers\AdminLTETemplateServiceProvider::class and 'AdminLTE' => Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::class to the 'providers' and 'aliases' arrays in config/app.php.
After running, composer update, I see the same error as above, followed by this error:
Script php artisan optimize handling the post-update-cmd event returned with error code 255
Finally, I ran this command:
php artisan vendor:publish --tag=adminlte -force
...which results in this error:
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Acacha\AdminLTETemplateLaravel\Providers\AdminLTETemplateServiceProvider' not found
What am I doing wrong? I am using Laravel 5.4.36 and PHP 5.6.25.
Also, I am having a problem setting the domain or URL to e.g. laravel.dev.

Go to App\Providers and In the AppServiceProvider.php, you did not include the necessary use statement at the top of the file.
use Illuminate\Support\Facades\Schema;
That defines the namespace path to the Schema class so you can simply call
Schema::defaultStringLength(191);
in the boot method.

Related

Undefined type 'Validator'.intelephense(1009)

Can anyone help me with this error? Im new to laravel and i was making a productController file but im getting this error from Validator:
I have called use Validator; What else can i do
Install the following package:
composer require --dev barryvdh/laravel-ide-helper
After, run:
php artisan ide-helper:models
php artisan ide-helper:generate
php artisan ide-helper:meta
And finally, install this extension on your vs code: https://marketplace.visualstudio.com/items?itemName=georgykurian.laravel-ide-helper
Also, another good to have (optional): https://marketplace.visualstudio.com/items?itemName=bmewburn.vscode-intelephense-client
It should solve your problem.

Laravel 8. Seeder class does not exist

This problem is not new, but I’ve looked and tried all the proposed solutions in other threads with no success.
I’m working with Laravel 8 with Homestead, is a new installation on a Windows 10 machine, not an upgrade.
I’m trying to seed a file called HotelSeeder.php. When I run the command
php artisan db:seed
I get the next error:
My HotelSeeder class goes like this:
My DatabaseSeeder class goes like this:
Both classes are located in the directory database/seeders
Autoload in composer.json goes like this:
After I run vagrant up and vagrant ssh, the commands that I’m running are:
php composer auto-load
php artisan db:seed
And the error shows up.
I've tried also:
php artisan db:seed --class=HotelSeeder
php artisan migrate:fresh –seed
php artisan clear:cache
php artisan optimize
Nothing seems to work. I hope you can help me.
Try the command:
composer dump-autoload --optimize
then:
php artisan db:seed
Your seeder class is named Database\Seeders\HotelSeeder. In your DatabaseSeeder.php file you should remove the alias for HotelSeeder as that is saying you want to alias a class from the root namespace named HotelSeeder which is not your class. If you remove that alias then the reference to HotelSeeder will actually be your correct class, Database\Seeders\HotelSeeder because the current namespace of this file is Database\Seeders so all class references are to that namespace.
Remove: use HotelSeeder;
Just a PHP namespacing thing.

Class 'AlgoliaSearch\Version' not found

I am trying to add algolia search system into my laravel(5.6) web app. For this,
I followed below instructions
composer require laravel/scout
php artisan vendor:publish --provider="Laravel\Scout\ScoutServiceProvider"
use Searchable trait into my User model
use Laravel\Scout\Searchable;
composer require algolia/algoliasearch-client-php
php artisan scout:import "App\User"
I also set (ALGOLIA_APP_ID) and (ALGOLIA_SECRET) both of my .env and scout.php file
I also added some dummy data to my users table and when I try to import those data to my algolia site by using (php artisan scout:import "App\User") this command I am getting this error (Class 'AlgoliaSearch\Version' not found)
I had the almost same problem
When I was doing the batch import using the command php artisan scout:import
got this Error:
In EngineManager.php line 31:
Class 'AlgoliaSearch\Version' not found
Downgrading the version fixed it
composer require algolia/algoliasearch-client-php:^1.27

How can I resolve installation error with Laravel LaraAdmin?

I'm trying to setup a fresh install of LaraAdmin
http://laraadmin.com
I've been following these instructions:
http://laraadmin.com/docs/1.0/installation#install
I receive an error when I get to the step of running
php artisan la:install
The Error received is:
[Symfony\Component\Debug\Exception\FatalThrowableError] Class 'Dwij\Laraadmin\LAProvider' not found
I tried installing 3 times, twice with a local composer installation and once with a global composer installation - both resulting in the same error.
I've also confirmed that Dwij\Laraadmin\LAProvider::class is included in the providers section of config/app.php
When I change Dwij\Laraadmin\LAProvider::class to Dwij\Laraadmin\LAProviderASDF::class in config/app.php - the error becomes:
[Symfony\Component\Debug\Exception\FatalThrowableError] Class 'Dwij\Laraadmin\LAProviderASDF' not found
So it's clear that the added line of code in config/app.php triggers this error.
How can I resolve the class not found error?
You need to import laraAdmin classes first via composer in the terminal:
composer require "dwij/laraadmin:1.0.40"
After that, you'll be fine running php artisan la:install
Paste this line bottom of the providers in config/app.php
Dwij\Laraadmin\LAProvider::class

Laravel 5 composer wont update class not found

Whenever I do composer update or artisan cache:clear and I get the following error:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Fatal error: Class 'Aws\Laravel\AwsServiceProvider' not found
My app.php config file doesn't contain the AWS in the providers and or aliases. I've tried adding 'Aws\Laravel\AwsServiceProvider::class,' under providers and 'AWS => Aws\Laravel\AwsFacade::class,' under aliases but still the same issue. I think something is caching weird and doesn't recognize the updates I'm doing on app.php config file.
delete the files (not the directory) in bootstrap/cache
run composer dump-autoload
remove config/aws.php if it exists
run composer install
just do a : composer dump-autoload
and after that try to run you command like normal: composer update

Categories