Did you run composer install? It sounds to me that you're missing some dependencies.
Oct 1, 2020
7
Level 1
Class 'Symfony\Component\EventDispatcher\Event' not found
i was get bug from Event when i upload my image in server
Error
Class 'Symfony\Component\EventDispatcher\Event' not found in line 10
and this my code call Event
public static function uploadFileStore($file, $nameDir, $redirect = 'Admin\Admin', $params = [])
{
$storage = \App\Common\Factory\Storage::getInstance()->getDriver();
$rand = rand(1, 100000);
$milliseconds = self::milliseconds();
$file_name = $nameDir . '/' . $milliseconds . '-' . $rand . '-' . Utility::makeFilename($file->getClientOriginalName());
try {
$storage->put($file_name, $file->path());
return $attachFile = $file_name;
} catch (S3Exception $e) {
return redirect()->action($redirect, $params)
->withError(__('messages.upload.validate.upload_error'));
}
}
code die after calling put method. and this is put method
public function put($key, $filePath)
{
$log = new Log('aws');
try {
$client = S3Client::factory($this->getConfigs());
$response = $client->putObject(array(
'Bucket' => $this->getBucket(),
'Key' => $key,
'SourceFile' => $filePath,
'ContentType' => mimetype_from_filename($key),
));
$log->addRecord("Success: put file", Log::INFO, ['data' => $response]);
return $response;
} catch (S3Exception $e) {
$log->addRecord("Error: put file", Log::ERROR, ['data' => $e]);
}
}
and i try using another class
use Illuminate\Http\Testing\MimeType;
and i change method calling $key
'ContentType' => MimeType::from($key),
this code in line 10 in file vendor/guzzle/guzzle/src/Guzzle/Common/Event.php
Please or to participate in this conversation.