我想在login页面中添加一个"保持登录状态"复选框.
除非用户注销,否则永远不应该结束用户的会话.
我知道在app/config/session.php中我有这些变量:
'lifetime' => 60,
'expire_on_close' => false,
Run Code Online (Sandbox Code Playgroud)
但是我希望永远保持会话,如果用户关闭导航器,则不会被删除.
关于我应该如何进行的任何想法?谢谢
我正在使用 laravel 刀片文件,我想知道这种方法是否会降低我的网站速度。这是我的文件结构:
show.blade.php 文件:
<div class="table-sections">
...
@include('elements/table',['name' => 'table1','blocks' => $blocks1])
...
@include('elements/table',['name' => 'table2','blocks' => $blocks2])
...
</div>
Run Code Online (Sandbox Code Playgroud)
table.blade.php 文件:
...
@foreach($blocks as $block)
...
@foreach($block['sections'] as $section)
...
@foreach($section['rows'] as $row)
...
@include('elements/row','row' => $row)
...
@endforeach
...
@endforeach
...
@endforeach
...
Run Code Online (Sandbox Code Playgroud)
row.blade.php 文件:
...
@foreach($row['attributes'] as $attribute)
...
// Making the '<td>' elements with their respective attributes and html
...
@endforeach
...
Run Code Online (Sandbox Code Playgroud)
我有很多嵌套的“foreach”块控制部分,所以我想知道在这种情况下不使用刀片是否更好(例如对于 row.blade.php 文件)
你有什么建议?
我想要减少我的 slug 大小的方法,我想知道是否可以忽略这些文件夹/node_modules、、、或者这会给我带来一些问题吗?/storage/tmp
另外,请告诉我您可能需要减小块大小的任何其他提示。
我只想在存在“ needs_login”的情况下验证“ account_id”。我这样做:
$rules = [
'account_id' => ['required_with:needs_login','custom_validation']
];
Run Code Online (Sandbox Code Playgroud)
但这是行不通的,因为如果needs_login字段不存在,但account_id具有某些值,则它将尝试执行“ custom_validation”。我还尝试输入“有时”参数
$rules = [
'account_id' => ['required_with:needs_login', 'sometimes', 'custom_validation']
];
Run Code Online (Sandbox Code Playgroud)
但这没用。
有任何想法吗?
PS:请记住,我只想在有needs_login时才对account_id进行验证,而不是在需要Needs_login时才检查是否有account_id。