I try to check "SSL Certificate" with Spatie\SslCertificate\SslCertificate but it doesn't work. I try it in laravel 7.6.0 I try all things like do "composer update" and do "auto-load (because is automated by composer maybe (?))"
So, the error is Undefined type 'Spatie\SslCertificate\SslCertificate'.intelephense(1009)
But i have declare the package in my class like this use Spatie\SslCertificate\SslCertificate;
Did i miss some steps in here or something else?
This is my full code in DorController class;
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Spatie\SslCertificate\SslCertificate;
class DorController extends Controller
{
public function yeah_1(){
$certificate = SslCertificate::createForHostName('spatie.be');
return $certificate->isValid();
}
}
This is my composer.json (is completly no bugs)
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2.5",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "^7.0",
"laravel/tinker": "^2.0",
"spatie/ssl-certificate": "^1.22"
},
"require-dev": {
"facade/ignition": "^2.0",
"fzaninotto/faker": "^1.9.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
}
}
I am sorry if this question is so basic or stupid I really sorry for it
Aucun commentaire:
Enregistrer un commentaire