session()->getHandler();
session()->getID();
$user = // получаем юзера;
session()->getHandler()->destroy($user->session_id);
<?php
$pathFile = rtrim(ini_get('session.save_path'),'/').'/' . $sessionId;
if(file_exists($pathFile)){
echo "File exists!";
//unlink($pathFile);
}
По после запроса на then почему то не работает и кидает трейс на моменте compileScope.$apply();
$q = Tags::where('name', 'LIKE', '%' . $like . '%')
->whereNotIn('id', $deprecate)
->where(function ($q) use ($id) {
$q->whereHas('closure', function ($q) use ($id) {
$q->where('tags_closure.ancestor_id', '=', $id);
})->orWhere(function ($q) {
$q->where('is_sealed', 1);
});
})
->with('closure');
$sql = $q->toSql();
var_dump($sql);
$response = $client->request('PUT', '/put', ['json' => ['foo' => 'bar']]);
private function rules($list)
$this->rules($list);
public function store($tags)
{
try {
DB::transaction(function () use ($tags) {
$this->recursive($tags, null);
});
} catch (ValidationException $e) {
return redirect('tags-closure')->withInput($e->getMessage());
}
}
private function recursive($list, $parentId)
{
if ($this->checkToFillable($list)) {
$this->validate($list);
$id = DB::table('tags')->insertGetId(
array(
'name' => $list['name'],
'description' => $list['description'],
'parent_id' => $parentId
)
);
if ($parentId) {
$query = "INSERT INTO `tags_closure` (`ancestor_id`, `descendant_id`, `depth`)
SELECT `ancestor_id`, $id, `depth`+1
FROM `tags_closure`
WHERE `descendant_id` =" . $parentId;
DB::statement($query);
} else {
DB::table('tags_closure')->insert(
[
'ancestor_id' => $id,
'descendant_id' => $id,
'depth' => 0
]
);
}
if (isset($list['closureTag'])) {
$this->recursive($list['closureTag'], $id);
}
} else {
foreach ($list as $element) {
$this->recursive($element, $parentId);
}
}
}
private function validate($list)
{
Validator::make([
'name' => $list['name'],
'description' => $list['description'],
], [
'name' => 'required|scripts',
'description' => 'required|scripts'
]);
}
<div data-for-tree="some[closure][1]">child 1</div>
<div data-for-tree="some[closure][2]">child 2</div>
$(':regex(data-for-tree,some\\[closure\\]\\[\\d\\])')
Required
Required If
Required Unless
Required With
Required With All
Required Without
Required Without All
Same