Laravel Charts Package: Class '' not found - laravel-5

Larevel Charts 6.3 is the package for chart. I have read docs. 4 times. "there is not Aliases new version 6.3 of package" & my laravel version is 5.6
use Charts;
$chart = Charts::database($users, 'bar', 'highcharts')
->title("Monthly new Register Users")
->groupByMonth(date('Y'), true);
ERROR:
Class 'ConsoleTVs\Charts\Facades\Charts' not found
This line in my config/app.php: 'aliases'
ERROR In command:

Related

How do you add sentinel to Laravel project?

I have this method:
$user=Sentinel::findById($user->id);
$reminder=Reminder::exists($user)? : Reminder::create($user);
$this->sendEmail($user, $reminder->code);
return redirect()->back()->with(['success'=>'reset code sent']);
However it shows an error, Undefined type 'App\Http\Controllers\Security\Sentinel'
Does anyone know how to remove this error?
After installing the package, open your Laravel config file located at config/app.php and add the following lines.
In the $providers array add the following service provider for this package.
Cartalyst\Sentinel\Laravel\SentinelServiceProvider::class,
In the $aliases array add the following facades for this package.
'Activation' => Cartalyst\Sentinel\Laravel\Facades\Activation::class,
'Reminder' => Cartalyst\Sentinel\Laravel\Facades\Reminder::class,
'Sentinel' => Cartalyst\Sentinel\Laravel\Facades\Sentinel::class,
Source: https://cartalyst.com/manual/sentinel/5.x#laravel-8

Connection Firebase Firestore to laravel

I have installed laravel 5.8 and firebase project with firestore database.
"name": "laravel/framework",
"version": "v5.8.36",
Firestore database connected to android app. App fetches data good from Firestore. Than I want to create admin panel with laravel for android app and want to integrate laravel with that database.But can not do this.
What I did:
installed php7.2
installed laravel 5.8.*
added php extension gRPC*
Added gRPC as a Composer dependency composer require "grpc/grpc:^v1.1.0" in laravel project
installed composer require google/cloud-firestore
Generated Firebase Admin SDK json file and saved into storage folder in laravel
Added this variable GOOGLE_APPLICATION_CREDENTIALS=/storage/files/progressive-yooung-team-firebase-adminsdk-ax7wi-d2a85ecabc.json (json file which generated firebase admin SDK) in .env file of laravel
installed composer require kreait/firebase-php ^4.35
Created Controller 'VarController' code:
<?php
namespace App\Http\Controllers;
use Kreait\Firebase\Factory;
class VarController extends Controller
{
public function index()
{
print_r("Output: 1");
$factory = new Factory();
print_r("Output: 2");
$firestore = $factory->createFirestore();
print_r("Output: 3");
$database = $firestore->database();
$userRef = $database->collection('users');
$snapshot = $userRef->document('Hus')->snapshot();
if($snapshot->exists()) {
printf('Document data:' . PHP_EOL);
print_r($snapshot->data());
}
print_r("Output: 4");
}
}
Problem is, It does not fetch data from firestore document 'Hus' and its data exists:
users > Hus > name: "Husniddin"
I put print_r("Output: 1"), Output: 2, etc... in order to know where is problem. On screen I see only: Output: 1 Output: 2.
Also don't forget to import these .
use Kreait\Firebase\Factory;
use Kreait\Firebase\ServiceAccount;
use \Kreait\Firebase\Database;
use Google\Cloud\Firestore\FirestoreClient;
After that , call the ServiceAccount() inside your function.
$serviceAccount = ServiceAccount::fromJsonFile(__DIR__.'/Firebase.json');
$firebase = (new Factory)
->withServiceAccount($serviceAccount);
$firestore = new FirestoreClient([
'projectId' => 'Your project name',
]);
$collectionReference = $firestore->collection('users');
$documentReference = $collectionReference->document('Search element from document');
$snapshot = $documentReference->snapshot();
change
$snapshot = $userRef->document('Hus')->snapshot();
to
$snapshot = $userRef->document('Hus')->documents();

Elastic search for Laravel using Laravel Scout

I am creating demo for Elastic search for Laravel using Laravel Scout.I have used this site for refernce= https://medium.com/#samogorm/basic-search-functionality-with-elasticsearch-laravel-scout-6ac182c99cbf. I have install
ElasticSearch , Java version to machine and follow step of above link, but when I run command
-php artisan scout:import “App\Account”
I got error
Symfony\Component\Debug\Exception\FatalThrowableError : Class
'app\Account' not found
at
/home/ashwinibhandare/Code/Elasticsearch/vendor/laravel/scout/src/Console/ImportCommand.php:35
31| public function handle(Dispatcher $events)
32| {
33| $class = $this->argument('model');
34|
35| $model = new $class;
36|
37| $events->listen(ModelsImported::class, function ($event) use ($class) {
38| $key = $event->models->last()->getScoutKey();
39|
Exception trace:
1
Laravel\Scout\Console\ImportCommand::handle(Object(Illuminate\Events\Dispatcher))
/home/ashwinibhandare/Code/Elasticsearch/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29
2 call_user_func_array()
/home/ashwinibhandare/Code/Elasticsearch/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29
Please use the argument -v to see more details.
I am not experience person, Can you please suggest me what is wrong

PHP Fatal error: Class 'SoapClient' not found in laravel 5.4

I am working with laravel 5.4. The controller function that using laravel run in browser is working. Same function I called via scheduler it returns error.
Note: Soapclient is enabled in my server.
In Controller code:
use SoapClient;
$client = new SoapClient($wsdl, array(
'soap_version' => SOAP_1_1,
'trace' => true, //to debug
));
and in kernel.php
$schedule->command('eld:fetch')
->everyMinute();
PHP Fatal error: Class 'SoapClient' not found in laravel 5.4 means that the SoapClient class does not been enabled in your server. To do so, follow these steps:
Check first if it's enabled with phpinfo() function and look in the array if SoapClient is mentioned enabled. If it's not enabled, follow the second step.
Uncomment the extension=php_soap.dll line by removing the semicolon at the beginning, in php.ini file.
The next step is to restart your server.
Now return again to the first step to see if SoapClient is now enabled.
At this step, you can now import your class like this:
use SoapClient;
$client = new SoapClient($wsdl, array('soap_version' => SOAP_1_1, 'trace' => true));

Class 'App\Http\Controllers\App' not found in laravel 5.2

I am try to use laravel-snappy for pdf generation.
step 1:
run composer require barryvdh/laravel-snappy
step 2:
add in providers Barryvdh\DomPDF\ServiceProvider::class, and aliases 'PDF' => Barryvdh\DomPDF\Facade::class, in app.php
step 3:
create function
public function pdfTest() {
$pdf = App::make('snappy.pdf.wrapper');
$pdf->loadHTML('<h1>Test</h1>');
return $pdf->inline();
}
then found error:
Class 'App\Http\Controllers\App' not found
How to resolve it.I appreciate all response. Thanks Ahead.
Add a backward slash before this line: \App::make('snappy.pdf.wrapper');
Or add use App; below your namespace.

Resources