我画了谷歌图表.现在,我想把按钮以pdf格式保存图表.我从这里看起来将谷歌图表保存为pdf和堆栈中可用的其他问题,但它不起作用.
通过已使用的谷歌图表打印png图像,但它只是打开一个带有png图像的新选项卡,但它不会为用户打开另存为pdf窗口.
有谁知道有办法吗?
我正在使用laravel 5为个人资料创建编辑表单,并可以更新表单中的图片。
我想以编辑形式存储新图像。我在edit.blade中使用此代码按用户获取图像。
视图:
{!! Form::model($dataItemregistration,['method' => 'PATCH', 'action' => ['Modul\ProfilController@update', $dataItemregistration->ItemRegistrationID, 'files' => true] ]) !!}
<div class="form-group">
<div class="row">
<div class="col-lg-3">
{{ Form::label('pic', 'Gambar (Saiz gambar, 250x300px)') }}
</div>
<div class="col-lg-7">
{!! Form::file('gambar', array('class' => 'form-control')) !!}
</div>
</div>
</div>
<br>
<div class="col-lg-10 text-center">
{!! link_to(URL::previous(),'Back', ['class' => 'btn btn-warning btn-md']) !!}
{{ Form::submit('Update', ['class' => 'btn btn-primary']) }}
</div>
{!! Form::close() !!}
Run Code Online (Sandbox Code Playgroud)
控制器:
public function update(Request $request, $id)
{
$valueitemregistrations = Itemregistration::find($id);
$this->validate($request,['gambar' => 'max:100000',]);
if ($request->hasFile('gambar')) …
Run Code Online (Sandbox Code Playgroud) 我需要检查 if 语句中的条件以获得多个权限。它使用 laravel 的 spatie 包。我使用下面的代码,但它似乎不起作用。可以显示输出,但输出不正确。它不会过滤条件。
if (auth()->user()->can('View Consultant') || auth()->user()('View Administration')
|| auth()->user()('View Accountant') || auth()->user()('All departments'))
{
$itemregistrations = DB::table('itemregistrations')
->where('categoryid','=', '1',',','2',',','3')
->get();
return view('profil.index', compact('itemregistrations'));
}
Run Code Online (Sandbox Code Playgroud)
代码是否正确?
条件是有权限的用户(查看顾问、查看行政、查看会计、所有部门)可以查看所有部门的顾问、行政、会计列表。
有权限的用户(仅查看顾问)只能查看顾问列表。