gpt4 book ai didi

php - ...vendor/composer/ClassLoader.php :444 (Laravel) 中没有这样的文件或目录

转载 作者:行者123 更新时间:2023-12-05 00:46:23 25 4
gpt4 key购买 nike

我正在用 Laravel 编写代码。当我尝试用表单中的文件发帖时,它会抛出以下异常:

Got error 'PHP message: PHP Fatal error: Uncaught ErrorException: include(/var/www/vhosts/web2/httpdocs/vendor/composer/../../app/Exceptions/Handler.php): failed to open stream: No such file or directory in /var/www/vhosts/web2/httpdocs/vendor/composer/ClassLoader.php:444\nStack trace:\n#0
. . .

n#5 /var/www/vhosts/web2/httpdocs/vendor/laravel/framework/src/Illuminate/Container/Container.php(803): ReflectionClass->__construct('App\...', referer: (hidden)

add.blade.php:

@include('flash::message')
<form class="form-horizontal" enctype="multipart/form-data" action="{{action('SheetController@add')}}" method="post">
@csrf
<div class="form-group">
<label class="col-md-4 control-label" for="icao">ICAO</label>
<div class="form-group col-md-4">
<input placeholder="i.e. SAAC" class="form-control input-md" id="icao" name="icao" type="text" required />
</div>
</div>

<div class="form-group">
<label class="col-md-4 control-label" for="fir">FIR</label>
<div class="col-md-4">
<select id="fir" name="fir" class="form-control input-md" required>
<option value="SAEF">Ezeiza</option>
<option value="SACF">C&oacute;rdoba</option>
<option value="SAMF">Mendoza</option>
<option value="SAVF">Comodoro Rivadavia</option>
<option value="SARR">Resistencia</option>
</select>
</div>
</div>

<div class="form-group">
<label class="col-md-4 control-label" for="version">Version</label>
<div class="form-group col-md-4">
<input placeholder="i.e. 1.2" class="form-control input-md" id="version" name="version" type="text" required />
</div>
</div>

<!-- File input-->
<div class="form-group">
<label class="col-md-4 control-label" for="sheetfile">Archivo</label>
<div class="col-md-4">
<input id="sheetfile" name="sheetfile" class="form-control input-md" required type="file">
</div>
</div>

<hr style="margin-bottom:20px;">

<div class="form-group">
<div class="btn-group">
<button type="submit" class="btn btn-success">Add</button>
<input type="reset" class="btn btn-warning" value="Reset" />
</div>
</div>

</form>

SheetController.php:

public function add(Request $request)
{
if(!empty($request->all()))
{
$sheet = new Sheet();
$sheet->icao = $request->icao;
$sheet->fir = $request->fir;
$sheet->version = $request->version;

$newName = $sheet->icao.'_v'.$sheet->version.'.pdf';

if($request->file('sheetfile')->getClientOriginalExtension() != 'pdf')
{
flash()->error('File not allowed')->important();
}
else if($request->imagen->storeAs('ATC/Sheets', $newName, 'files'))
{
if($sheet->save()) flash()->success('Sheet added')->important();
else flash()->error($sheet->errors()->first())->important();
}
else flash()->error('The file could not be uploaded.')->important();
}
return redirect()->action('SheetController@list');
}

我已经尝试过 composer updatecomposer dump-autoload

有什么想法吗?

最佳答案

你可以简单地做,

composer update

对我来说效果很好。

关于php - ...vendor/composer/ClassLoader.php :444 (Laravel) 中没有这样的文件或目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60954509/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com