File tree 1 file changed +36
-0
lines changed
1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php namespace Arcanedev \Support \Traits ;
2
+
3
+ /**
4
+ * Trait AbortTrait
5
+ *
6
+ * @package Arcanedev\Support\Traits
7
+ * @author ARCANEDEV <arcanedev.maroc@gmail.com>
8
+ */
9
+ trait AbortTrait
10
+ {
11
+ /* ------------------------------------------------------------------------------------------------
12
+ | Main Functions
13
+ | ------------------------------------------------------------------------------------------------
14
+ */
15
+ /**
16
+ * Throw Page not found [404].
17
+ *
18
+ * @param string $message
19
+ * @param array $headers
20
+ */
21
+ protected static function pageNotFound ($ message = 'Page not Found ' , array $ headers = [])
22
+ {
23
+ abort (404 , $ message , $ headers );
24
+ }
25
+
26
+ /**
27
+ * Throw AccessNotAllowed [403].
28
+ *
29
+ * @param string $message
30
+ * @param array $headers
31
+ */
32
+ protected static function accessNotAllowed ($ message = 'Access denied ! ' , array $ headers = [])
33
+ {
34
+ abort (403 , $ message , $ headers );
35
+ }
36
+ }
You can’t perform that action at this time.
0 commit comments