1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* Lenevor Framework |
5
|
|
|
* |
6
|
|
|
* LICENSE |
7
|
|
|
* |
8
|
|
|
* This source file is subject to the new BSD license that is bundled |
9
|
|
|
* with this package in the file license.md. |
10
|
|
|
* It is also available through the world-wide-web at this URL: |
11
|
|
|
* https://lenevor.com/license |
12
|
|
|
* If you did not receive a copy of the license and are unable to |
13
|
|
|
* obtain it through the world-wide-web, please send an email |
14
|
|
|
* to [email protected] so we can send you a copy immediately. |
15
|
|
|
* |
16
|
|
|
* @package Lenevor |
17
|
|
|
* @subpackage Base |
18
|
|
|
* @link https://lenevor.com |
19
|
|
|
* @copyright Copyright (c) 2019 - 2023 Alexander Campo <[email protected]> |
20
|
|
|
* @license https://opensource.org/licenses/BSD-3-Clause New BSD license or see https://lenevor.com/license or see /license.md |
21
|
|
|
*/ |
22
|
|
|
|
23
|
|
|
namespace Syscodes\Components\Http\Concerns; |
24
|
|
|
|
25
|
|
|
use Syscodes\Components\Database\Erostrine\Model; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* Trait InteractWithFlashData. |
29
|
|
|
*/ |
30
|
|
|
trait InteractsWithFlashData |
31
|
|
|
{ |
32
|
|
|
/** |
33
|
|
|
* Retrieve an old input item. |
34
|
|
|
* |
35
|
|
|
* @param string|null $key |
36
|
|
|
* @param \Syscodes\Components\Database\Eloquent\Model|string|array|null $default |
|
|
|
|
37
|
|
|
* |
38
|
|
|
* @return string|array|null |
39
|
|
|
*/ |
40
|
|
|
public function old($key = null, $default = null) |
41
|
|
|
{ |
42
|
|
|
$default = $default instanceof Model ? $default->getAttribute($key) : $default; |
43
|
|
|
|
44
|
|
|
return $this->hasSession() ? $this->session()->getOldInput($key, $default) : $default; |
|
|
|
|
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* Flash the input for the current request to the session. |
49
|
|
|
* |
50
|
|
|
* @return void |
51
|
|
|
*/ |
52
|
|
|
public function flash(): void |
53
|
|
|
{ |
54
|
|
|
$this->session()->flashInput($this->input()); |
|
|
|
|
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* Flash only some of the input to the session. |
59
|
|
|
* |
60
|
|
|
* @param array|mixed $keys |
61
|
|
|
* |
62
|
|
|
* @return void |
63
|
|
|
*/ |
64
|
|
|
public function flashOnly($keys): void |
65
|
|
|
{ |
66
|
|
|
$this->session()->flashInput( |
67
|
|
|
$this->only(is_array($keys) ? $keys : func_get_args()) |
|
|
|
|
68
|
|
|
); |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* Flash only some of the input to the session. |
73
|
|
|
* |
74
|
|
|
* @param array|mixed $keys |
75
|
|
|
* |
76
|
|
|
* @return void |
77
|
|
|
*/ |
78
|
|
|
public function flashExcept($keys): void |
79
|
|
|
{ |
80
|
|
|
$this->session()->flashInput( |
81
|
|
|
$this->except(is_array($keys) ? $keys : func_get_args()) |
|
|
|
|
82
|
|
|
); |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* Flush all of the old input from the session. |
87
|
|
|
* |
88
|
|
|
* @return void |
89
|
|
|
*/ |
90
|
|
|
public function flush(): void |
91
|
|
|
{ |
92
|
|
|
$this->session()->flashInput([]); |
93
|
|
|
} |
94
|
|
|
} |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths