This repository has been archived by the owner on Aug 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
crud.html
163 lines (158 loc) · 52.8 KB
/
crud.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>CRUD | Sanjab</title>
<meta name="generator" content="VuePress 1.5.4">
<link rel="icon" href="/images/favicon.ico">
<meta name="description" content="Sanjab is an admin package for laravel framework. create admin panels quick and extendiable.">
<meta property="og:site_name" content="Sanjab">
<meta property="og:title" content="CRUD">
<meta property="og:type" content="website">
<meta property="og:url" content="/crud.html">
<meta name="twitter:title" content="CRUD">
<meta name="twitter:url" content="/crud.html">
<meta name="twitter:card" content="summary_large_image">
<link rel="preload" href="/assets/css/0.styles.2e8fc617.css" as="style"><link rel="preload" href="/assets/js/app.bb080b10.js" as="script"><link rel="preload" href="/assets/js/3.0ca36dc4.js" as="script"><link rel="preload" href="/assets/js/43.dbde9849.js" as="script"><link rel="prefetch" href="/assets/js/10.f2fbcc00.js"><link rel="prefetch" href="/assets/js/11.a88150f7.js"><link rel="prefetch" href="/assets/js/12.3f4fc49f.js"><link rel="prefetch" href="/assets/js/13.2f7bbe92.js"><link rel="prefetch" href="/assets/js/14.f69c3be7.js"><link rel="prefetch" href="/assets/js/15.146fd77b.js"><link rel="prefetch" href="/assets/js/16.7040661a.js"><link rel="prefetch" href="/assets/js/17.10c67635.js"><link rel="prefetch" href="/assets/js/18.b258fc52.js"><link rel="prefetch" href="/assets/js/19.0d164613.js"><link rel="prefetch" href="/assets/js/20.2cf36932.js"><link rel="prefetch" href="/assets/js/21.8f19317a.js"><link rel="prefetch" href="/assets/js/22.3dc04c9b.js"><link rel="prefetch" href="/assets/js/23.7d93154e.js"><link rel="prefetch" href="/assets/js/24.d10068db.js"><link rel="prefetch" href="/assets/js/25.ecd8acc3.js"><link rel="prefetch" href="/assets/js/26.5ae91a18.js"><link rel="prefetch" href="/assets/js/27.1ae60bea.js"><link rel="prefetch" href="/assets/js/28.1dd28706.js"><link rel="prefetch" href="/assets/js/29.8c489115.js"><link rel="prefetch" href="/assets/js/30.effa9b52.js"><link rel="prefetch" href="/assets/js/31.5f330bfc.js"><link rel="prefetch" href="/assets/js/32.4ac193d2.js"><link rel="prefetch" href="/assets/js/33.afce904a.js"><link rel="prefetch" href="/assets/js/34.29769f89.js"><link rel="prefetch" href="/assets/js/35.85aef861.js"><link rel="prefetch" href="/assets/js/36.5b05176c.js"><link rel="prefetch" href="/assets/js/37.40a67162.js"><link rel="prefetch" href="/assets/js/38.0585aaff.js"><link rel="prefetch" href="/assets/js/39.085c73ff.js"><link rel="prefetch" href="/assets/js/4.fb05333f.js"><link rel="prefetch" href="/assets/js/40.667cd531.js"><link rel="prefetch" href="/assets/js/41.9bf9596e.js"><link rel="prefetch" href="/assets/js/42.7bf6bc5a.js"><link rel="prefetch" href="/assets/js/44.a1a7fab3.js"><link rel="prefetch" href="/assets/js/45.af6c374b.js"><link rel="prefetch" href="/assets/js/46.22ab45aa.js"><link rel="prefetch" href="/assets/js/47.095fc7de.js"><link rel="prefetch" href="/assets/js/48.fafabd31.js"><link rel="prefetch" href="/assets/js/49.8b56a6bd.js"><link rel="prefetch" href="/assets/js/5.57d9df4b.js"><link rel="prefetch" href="/assets/js/50.523e948d.js"><link rel="prefetch" href="/assets/js/51.2b0f3efa.js"><link rel="prefetch" href="/assets/js/6.3a56987d.js"><link rel="prefetch" href="/assets/js/7.8bfd5ac9.js"><link rel="prefetch" href="/assets/js/8.3d2834af.js"><link rel="prefetch" href="/assets/js/9.e3de8168.js"><link rel="prefetch" href="/assets/js/vendors~docsearch.26dc1fe9.js">
<link rel="stylesheet" href="/assets/css/0.styles.2e8fc617.css">
</head>
<body>
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><img src="/images/logo.svg" alt="Sanjab" class="logo"> <span class="site-name can-hide">Sanjab</span></a> <div class="links"><form id="search-form" role="search" class="algolia-search-wrapper search-box"><input id="algolia-search-input" class="search-query"></form> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://discord.gg/kwuTZQd" target="_blank" rel="noopener noreferrer" class="nav-link external">
Discussion
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <a href="https://github.com/sanjabteam/sanjab" target="_blank" rel="noopener noreferrer" class="repo-link">
GitHub
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://discord.gg/kwuTZQd" target="_blank" rel="noopener noreferrer" class="nav-link external">
Discussion
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <a href="https://github.com/sanjabteam/sanjab" target="_blank" rel="noopener noreferrer" class="repo-link">
GitHub
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav> <ul class="sidebar-links"><li><a href="/" aria-current="page" class="sidebar-link">Sanjab</a></li><li><a href="/install.html" class="sidebar-link">Installation</a></li><li><a href="/crud.html" aria-current="page" class="active sidebar-link">CRUD</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/crud.html#example" class="sidebar-link">Example</a></li><li class="sidebar-sub-header"><a href="/crud.html#methods" class="sidebar-link">Methods</a></li><li class="sidebar-sub-header"><a href="/crud.html#properties" class="sidebar-link">properties</a></li><li class="sidebar-sub-header"><a href="/crud.html#init" class="sidebar-link">init</a></li><li class="sidebar-sub-header"><a href="/crud.html#queryscope" class="sidebar-link">queryScope</a></li><li class="sidebar-sub-header"><a href="/crud.html#validationrules" class="sidebar-link">validationRules</a></li><li class="sidebar-sub-header"><a href="/crud.html#validationattributes" class="sidebar-link">validationAttributes</a></li><li class="sidebar-sub-header"><a href="/crud.html#validationmessages" class="sidebar-link">validationMessages</a></li><li class="sidebar-sub-header"><a href="/crud.html#validationafter" class="sidebar-link">validationAfter</a></li><li class="sidebar-sub-header"><a href="/crud.html#modifyrequest" class="sidebar-link">modifyRequest</a></li><li class="sidebar-sub-header"><a href="/crud.html#modifyresonse" class="sidebar-link">modifyResonse</a></li><li class="sidebar-sub-header"><a href="/crud.html#model-events" class="sidebar-link">Model Events</a></li><li class="sidebar-sub-header"><a href="/crud.html#other-details" class="sidebar-link">Other Details</a></li></ul></li><li><a href="/setting.html" class="sidebar-link">Setting</a></li><li><section class="sidebar-group collapsable depth-0"><a href="/widgets" class="sidebar-heading clickable"><span>Widgets</span> <span class="arrow right"></span></a> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><a href="/cards" class="sidebar-heading clickable"><span>Cards</span> <span class="arrow right"></span></a> <!----></section></li><li><a href="/actions.html" class="sidebar-link">Actions</a></li><li><a href="/localization.html" class="sidebar-link">Localization</a></li><li><a href="/authorization.html" class="sidebar-link">Authorization</a></li><li><a href="/compile.html" class="sidebar-link">Custom compile</a></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="crud"><a href="#crud" class="header-anchor">#</a> CRUD</h1> <p><img src="/images/screenshots/crud.jpg" alt="Crud list"> <img src="/images/screenshots/crud_form.jpg" alt="Crud form"></p> <ul><li><a href="#example">Example</a></li> <li><a href="#methods">Methods</a></li> <li><a href="#properties">properties</a></li> <li><a href="#init">init</a></li> <li><a href="#queryscope">queryScope</a></li> <li><a href="#validationrules">validationRules</a></li> <li><a href="#validationattributes">validationAttributes</a></li> <li><a href="#validationmessages">validationMessages</a></li> <li><a href="#validationafter">validationAfter</a></li> <li><a href="#modifyrequest">modifyRequest</a></li> <li><a href="#modifyresonse">modifyResonse</a></li> <li><a href="#model-events">Model Events</a></li> <li><a href="#other-details">Other Details</a></li></ul> <p>CRUD Controllers are controllers that handle resources Create/Edit/Update/Delete. CRUD Controllers working with a model and list of the model fields that in sanjab we call them Widget. Each widget handling operation like saving, form field, view field, table field, search, sort and etc.</p> <h2 id="example"><a href="#example" class="header-anchor">#</a> Example</h2> <p>Let's create a sample crud controller step by step. Our sample is a simple <strong>Category</strong> resource that contains name, description, and image.</p> <h4 id="step-1"><a href="#step-1" class="header-anchor">#</a> Step 1</h4> <p>Create a model and migrations.</p> <div class="language-bash extra-class"><pre class="language-bash"><code>php artisan make:model -m Category
</code></pre></div><h4 id="step-2"><a href="#step-2" class="header-anchor">#</a> Step 2</h4> <p>Fill migration and model.</p> <div class="language-php extra-class"><pre class="language-php"><code>Schema<span class="token punctuation">:</span><span class="token punctuation">:</span><span class="token function">create</span><span class="token punctuation">(</span><span class="token single-quoted-string string">'categories'</span><span class="token punctuation">,</span> <span class="token keyword">function</span> <span class="token punctuation">(</span>Blueprint <span class="token variable">$table</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
<span class="token variable">$table</span><span class="token operator">-</span><span class="token operator">></span><span class="token function">bigIncrements</span><span class="token punctuation">(</span><span class="token single-quoted-string string">'id'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token variable">$table</span><span class="token operator">-</span><span class="token operator">></span><span class="token function">string</span><span class="token punctuation">(</span><span class="token single-quoted-string string">'name'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token variable">$table</span><span class="token operator">-</span><span class="token operator">></span><span class="token function">string</span><span class="token punctuation">(</span><span class="token single-quoted-string string">'image'</span><span class="token punctuation">)</span><span class="token operator">-</span><span class="token operator">></span><span class="token function">nullable</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token variable">$table</span><span class="token operator">-</span><span class="token operator">></span><span class="token function">text</span><span class="token punctuation">(</span><span class="token single-quoted-string string">'description'</span><span class="token punctuation">)</span><span class="token operator">-</span><span class="token operator">></span><span class="token function">nullable</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token variable">$table</span><span class="token operator">-</span><span class="token operator">></span><span class="token function">timestamps</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><p>Model:</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">class</span> <span class="token class-name">Category</span> <span class="token keyword">extends</span> <span class="token class-name">Model</span>
<span class="token punctuation">{</span>
<span class="token keyword">protected</span> <span class="token variable">$fillable</span> <span class="token operator">=</span> <span class="token punctuation">[</span>
<span class="token single-quoted-string string">'name'</span><span class="token punctuation">,</span>
<span class="token single-quoted-string string">'image'</span><span class="token punctuation">,</span>
<span class="token single-quoted-string string">'description'</span>
<span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><h4 id="step-3"><a href="#step-3" class="header-anchor">#</a> Step 3</h4> <p>Migrate.</p> <div class="language-bash extra-class"><pre class="language-bash"><code>php artisan migrate
</code></pre></div><h4 id="step-4"><a href="#step-4" class="header-anchor">#</a> Step 4</h4> <p>Make Sanjab controllers.</p> <div class="language-bash extra-class"><pre class="language-bash"><code>php artisan sanjab:make:crud CategoryController
</code></pre></div><h4 id="step-5"><a href="#step-5" class="header-anchor">#</a> Step 5</h4> <p>Change the content of <code>app/Http/Controllers/Admin/Crud/CategoryController.php</code>.</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token keyword">namespace</span> <span class="token package">App<span class="token punctuation">\</span>Http<span class="token punctuation">\</span>Controllers<span class="token punctuation">\</span>Admin<span class="token punctuation">\</span>Crud</span><span class="token punctuation">;</span>
<span class="token keyword">use</span> <span class="token package">Sanjab<span class="token punctuation">\</span>Widgets<span class="token punctuation">\</span>IdWidget</span><span class="token punctuation">;</span>
<span class="token keyword">use</span> <span class="token package">Sanjab<span class="token punctuation">\</span>Widgets<span class="token punctuation">\</span>TextWidget</span><span class="token punctuation">;</span>
<span class="token keyword">use</span> <span class="token package">Sanjab<span class="token punctuation">\</span>Helpers<span class="token punctuation">\</span>MaterialIcons</span><span class="token punctuation">;</span>
<span class="token keyword">use</span> <span class="token package">Sanjab<span class="token punctuation">\</span>Helpers<span class="token punctuation">\</span>CrudProperties</span><span class="token punctuation">;</span>
<span class="token keyword">use</span> <span class="token package">Sanjab<span class="token punctuation">\</span>Widgets<span class="token punctuation">\</span>TextAreaWidget</span><span class="token punctuation">;</span>
<span class="token keyword">use</span> <span class="token package">Sanjab<span class="token punctuation">\</span>Widgets<span class="token punctuation">\</span>File<span class="token punctuation">\</span>UppyWidget</span><span class="token punctuation">;</span>
<span class="token keyword">use</span> <span class="token package">Sanjab<span class="token punctuation">\</span>Controllers<span class="token punctuation">\</span>CrudController</span><span class="token punctuation">;</span>
<span class="token keyword">use</span> <span class="token package">Illuminate<span class="token punctuation">\</span>Database<span class="token punctuation">\</span>Eloquent<span class="token punctuation">\</span>Model</span><span class="token punctuation">;</span>
<span class="token keyword">class</span> <span class="token class-name">CategoryController</span> <span class="token keyword">extends</span> <span class="token class-name">CrudController</span>
<span class="token punctuation">{</span>
<span class="token keyword">protected</span> <span class="token keyword">static</span> <span class="token keyword">function</span> <span class="token function">properties</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> CrudProperties
<span class="token punctuation">{</span>
<span class="token keyword">return</span> CrudProperties<span class="token punctuation">:</span><span class="token punctuation">:</span><span class="token function">create</span><span class="token punctuation">(</span><span class="token single-quoted-string string">'categories'</span><span class="token punctuation">)</span>
<span class="token operator">-</span><span class="token operator">></span><span class="token function">model</span><span class="token punctuation">(</span>\<span class="token package">App<span class="token punctuation">\</span>Category</span><span class="token punctuation">:</span><span class="token punctuation">:</span><span class="token keyword">class</span><span class="token punctuation">)</span>
<span class="token operator">-</span><span class="token operator">></span><span class="token function">title</span><span class="token punctuation">(</span><span class="token double-quoted-string string">"Category"</span><span class="token punctuation">)</span>
<span class="token operator">-</span><span class="token operator">></span><span class="token function">titles</span><span class="token punctuation">(</span><span class="token double-quoted-string string">"Categories"</span><span class="token punctuation">)</span>
<span class="token operator">-</span><span class="token operator">></span><span class="token function">icon</span><span class="token punctuation">(</span>MaterialIcons<span class="token punctuation">:</span><span class="token punctuation">:</span><span class="token constant">GROUP_WORK</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token keyword">protected</span> <span class="token keyword">function</span> <span class="token function">init</span><span class="token punctuation">(</span>string <span class="token variable">$type</span><span class="token punctuation">,</span> Model <span class="token variable">$item</span> <span class="token operator">=</span> <span class="token constant">null</span><span class="token punctuation">)</span><span class="token punctuation">:</span> void
<span class="token punctuation">{</span>
<span class="token variable">$this</span><span class="token operator">-</span><span class="token operator">></span><span class="token property">widgets</span><span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token operator">=</span> IdWidget<span class="token punctuation">:</span><span class="token punctuation">:</span><span class="token function">create</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token variable">$this</span><span class="token operator">-</span><span class="token operator">></span><span class="token property">widgets</span><span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token operator">=</span> TextWidget<span class="token punctuation">:</span><span class="token punctuation">:</span><span class="token function">create</span><span class="token punctuation">(</span><span class="token single-quoted-string string">'name'</span><span class="token punctuation">)</span>
<span class="token operator">-</span><span class="token operator">></span><span class="token function">required</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token variable">$this</span><span class="token operator">-</span><span class="token operator">></span><span class="token property">widgets</span><span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token operator">=</span> TextAreaWidget<span class="token punctuation">:</span><span class="token punctuation">:</span><span class="token function">create</span><span class="token punctuation">(</span><span class="token single-quoted-string string">'description'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token variable">$this</span><span class="token operator">-</span><span class="token operator">></span><span class="token property">widgets</span><span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token operator">=</span> UppyWidget<span class="token punctuation">:</span><span class="token punctuation">:</span><span class="token function">image</span><span class="token punctuation">(</span><span class="token single-quoted-string string">'image'</span><span class="token punctuation">)</span>
<span class="token operator">-</span><span class="token operator">></span><span class="token function">width</span><span class="token punctuation">(</span><span class="token number">512</span><span class="token punctuation">)</span>
<span class="token operator">-</span><span class="token operator">></span><span class="token function">height</span><span class="token punctuation">(</span><span class="token number">512</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</span></code></pre></div><h4 id="step-6"><a href="#step-6" class="header-anchor">#</a> Step 6</h4> <p>Done!</p> <p>Open <code>yoursite/admin</code> and open <strong>Categories</strong> link in sidebar. Your CRUD is ready to use.
If you don't see link make sure your controller has been added to <code>controllers</code> in <code>config/sanjab.php</code>.</p> <h2 id="methods"><a href="#methods" class="header-anchor">#</a> Methods</h2> <h2 id="properties"><a href="#properties" class="header-anchor">#</a> properties</h2> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">protected</span> <span class="token keyword">static</span> <span class="token keyword">function</span> <span class="token function">properties</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> CrudProperties
</code></pre></div><p>This function returns CRUD controller properties. and should return an instance of <code>Sanjab\Helpers\CrudProperties</code> with all properties that need to override.</p> <div class="language-php extra-class"><pre class="language-php"><code>CrudProperties<span class="token punctuation">:</span><span class="token punctuation">:</span><span class="token function">create</span><span class="token punctuation">(</span><span class="token constant">ROUTE</span><span class="token punctuation">)</span>
<span class="token operator">-</span><span class="token operator">></span><span class="token function">property1</span><span class="token punctuation">(</span>value <span class="token number">1</span><span class="token punctuation">)</span>
<span class="token operator">-</span><span class="token operator">></span><span class="token function">property2</span><span class="token punctuation">(</span>value <span class="token number">2</span><span class="token punctuation">)</span>
</code></pre></div><h4 id="model"><a href="#model" class="header-anchor">#</a> model</h4> <p><code>type: string</code></p> <p>Model class name</p> <h4 id="title"><a href="#title" class="header-anchor">#</a> title</h4> <p><code>type: string</code></p> <p>Title of resource (singular)</p> <h4 id="titles"><a href="#titles" class="header-anchor">#</a> titles</h4> <p><code>type: string</code></p> <p>Title of resource (plural)</p> <h4 id="description"><a href="#description" class="header-anchor">#</a> description</h4> <p><code>type: string</code></p> <p>Description About controller</p> <h4 id="icon"><a href="#icon" class="header-anchor">#</a> icon</h4> <p><code>type: string</code></p> <p>Material icon name</p> <h4 id="creatable"><a href="#creatable" class="header-anchor">#</a> creatable</h4> <p><code>type: boolean</code></p> <p>Has creating form</p> <h4 id="showable"><a href="#showable" class="header-anchor">#</a> showable</h4> <p><code>type: boolean</code></p> <p>Has resource show action</p> <h4 id="editable"><a href="#editable" class="header-anchor">#</a> editable</h4> <p><code>type: boolean</code></p> <p>Has resource edit action</p> <h4 id="deletable"><a href="#deletable" class="header-anchor">#</a> deletable</h4> <p><code>type: boolean</code></p> <p>Has resource delete action</p> <h4 id="perpages"><a href="#perpages" class="header-anchor">#</a> perPages</h4> <p><code>type: array</code></p> <p>Array of possible per-page options (Example: <code>[5 => 5, 10 => 10, PHP_INT_MAX => "All"]</code>)</p> <h4 id="perpage"><a href="#perpage" class="header-anchor">#</a> perPage</h4> <p><code>type: int</code></p> <p>The default value of <code>perpages</code></p> <h4 id="defaultorder"><a href="#defaultorder" class="header-anchor">#</a> defaultOrder</h4> <p><code>type: string</code></p> <p>Default order column</p> <h4 id="defaultorderdirection"><a href="#defaultorderdirection" class="header-anchor">#</a> defaultOrderDirection</h4> <p><code>type: string</code></p> <p>Default order column direction "asc" or "desc"</p> <h4 id="permissionskey"><a href="#permissionskey" class="header-anchor">#</a> permissionsKey</h4> <p><code>type: string</code></p> <p>Use this when you want to have more than one CRUD controller for a model</p> <h4 id="bulk"><a href="#bulk" class="header-anchor">#</a> bulk</h4> <p><code>type: boolean</code></p> <p>Bulk actions are allowed or not</p> <h4 id="globalsearch"><a href="#globalsearch" class="header-anchor">#</a> globalSearch</h4> <p><code>type: boolean</code></p> <p>Should be shown on global search results or not</p> <h4 id="itemformat"><a href="#itemformat" class="header-anchor">#</a> itemFormat</h4> <p><code>type: string</code></p> <p>Format on global search (Example: <code>%id - %first_name</code>) default values are (<code>title</code> or <code>name</code> or
<code>id</code>)</p> <h4 id="defaultcard"><a href="#defaultcard" class="header-anchor">#</a> defaultCard</h4> <p><code>type: boolean</code></p> <p>Enable or disable default count card</p> <h4 id="defaultdashboardcard"><a href="#defaultdashboardcard" class="header-anchor">#</a> defaultDashboardCard</h4> <p><code>type: boolean</code></p> <p>Enable or disable default count card on the dashboard</p> <h4 id="badge"><a href="#badge" class="header-anchor">#</a> badge</h4> <p><code>type: function</code></p> <p>Function to create content of menu item badge (Example: <code>function () {return Model::where('status', 0)->count();}</code>)</p> <h4 id="badgevariant"><a href="#badgevariant" class="header-anchor">#</a> badgeVariant</h4> <p><code>type: string</code></p> <p>Menu item bootstrap badge variant (Examples: 'success', 'danger', ...)</p> <hr> <h2 id="init"><a href="#init" class="header-anchor">#</a> init</h2> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">protected</span> <span class="token keyword">function</span> <span class="token function">init</span><span class="token punctuation">(</span>string <span class="token variable">$type</span><span class="token punctuation">,</span> Model <span class="token variable">$item</span> <span class="token operator">=</span> <span class="token constant">null</span><span class="token punctuation">)</span><span class="token punctuation">:</span> void
</code></pre></div><p>This function called when using the controller before call action.
You can define controller <code>Widgets</code>, <code>Cards</code> and <code>Actions</code> in this function.</p> <p><strong>Parameters</strong></p> <p><em>$type</em></p> <p>type of action currently loading.</p> <p>possible values:</p> <ul><li>index: The Resource list</li> <li>create: Showing the create form or creating the model</li> <li>show: Show resource</li> <li>edit: Showing edit form or updating model</li> <li>action: When calling any actions</li></ul> <p><em>$item</em></p> <p>Model item when showing or editing the resource.</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">protected</span> <span class="token keyword">function</span> <span class="token function">init</span><span class="token punctuation">(</span>string <span class="token variable">$type</span><span class="token punctuation">,</span> Model <span class="token variable">$item</span> <span class="token operator">=</span> <span class="token constant">null</span><span class="token punctuation">)</span><span class="token punctuation">:</span> void
<span class="token punctuation">{</span>
<span class="token variable">$this</span><span class="token operator">-</span><span class="token operator">></span><span class="token property">widgets</span><span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">;</span>
<span class="token variable">$this</span><span class="token operator">-</span><span class="token operator">></span><span class="token property">cards</span><span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">;</span>
<span class="token variable">$this</span><span class="token operator">-</span><span class="token operator">></span><span class="token property">actions</span><span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">;</span>
<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="queryscope"><a href="#queryscope" class="header-anchor">#</a> queryScope</h2> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">protected</span> <span class="token keyword">function</span> <span class="token function">queryScope</span><span class="token punctuation">(</span>Builder <span class="token variable">$query</span><span class="token punctuation">)</span>
</code></pre></div><p>Modify query before loading resources.</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">protected</span> <span class="token keyword">function</span> <span class="token function">queryScope</span><span class="token punctuation">(</span>Builder <span class="token variable">$query</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>
<span class="token variable">$query</span><span class="token operator">-</span><span class="token operator">></span><span class="token function">where</span><span class="token punctuation">(</span><span class="token single-quoted-string string">'confirmed'</span><span class="token punctuation">,</span> <span class="token boolean constant">false</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">// Loading only non confirmed resources.</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="validationrules"><a href="#validationrules" class="header-anchor">#</a> validationRules</h2> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function">validationRules</span><span class="token punctuation">(</span>Request <span class="token variable">$request</span><span class="token punctuation">,</span> string <span class="token variable">$type</span><span class="token punctuation">,</span> Model <span class="token variable">$item</span> <span class="token operator">=</span> <span class="token constant">null</span><span class="token punctuation">)</span>
</code></pre></div><p>Returns array of validation rules.</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function">validationRules</span><span class="token punctuation">(</span>Request <span class="token variable">$request</span><span class="token punctuation">,</span> string <span class="token variable">$type</span><span class="token punctuation">,</span> Model <span class="token variable">$item</span> <span class="token operator">=</span> <span class="token constant">null</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>
<span class="token keyword">return</span> <span class="token punctuation">[</span>
<span class="token single-quoted-string string">'title'</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token single-quoted-string string">'required|string'</span>
<span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="validationattributes"><a href="#validationattributes" class="header-anchor">#</a> validationAttributes</h2> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function">validationAttributes</span><span class="token punctuation">(</span>Request <span class="token variable">$request</span><span class="token punctuation">,</span> string <span class="token variable">$type</span><span class="token punctuation">,</span> Model <span class="token variable">$item</span> <span class="token operator">=</span> <span class="token constant">null</span><span class="token punctuation">)</span>
</code></pre></div><p>Returns array of validation attribute names.</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function">validationAttributes</span><span class="token punctuation">(</span>Request <span class="token variable">$request</span><span class="token punctuation">,</span> string <span class="token variable">$type</span><span class="token punctuation">,</span> Model <span class="token variable">$item</span> <span class="token operator">=</span> <span class="token constant">null</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>
<span class="token keyword">return</span> <span class="token punctuation">[</span>
<span class="token single-quoted-string string">'title'</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token single-quoted-string string">'عنوان'</span>
<span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="validationmessages"><a href="#validationmessages" class="header-anchor">#</a> validationMessages</h2> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function">validationMessages</span><span class="token punctuation">(</span>Request <span class="token variable">$request</span><span class="token punctuation">,</span> string <span class="token variable">$type</span><span class="token punctuation">,</span> Model <span class="token variable">$item</span> <span class="token operator">=</span> <span class="token constant">null</span><span class="token punctuation">)</span>
</code></pre></div><p>Returns array of validation messages.</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function">validationMessages</span><span class="token punctuation">(</span>Request <span class="token variable">$request</span><span class="token punctuation">,</span> string <span class="token variable">$type</span><span class="token punctuation">,</span> Model <span class="token variable">$item</span> <span class="token operator">=</span> <span class="token constant">null</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>
<span class="token keyword">return</span> <span class="token punctuation">[</span>
<span class="token single-quoted-string string">'title.required'</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token single-quoted-string string">'Title field is a required field'</span>
<span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="validationafter"><a href="#validationafter" class="header-anchor">#</a> validationAfter</h2> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function">validationAfter</span><span class="token punctuation">(</span>Validator <span class="token variable">$validator</span><span class="token punctuation">,</span> Request <span class="token variable">$request</span><span class="token punctuation">,</span> string <span class="token variable">$type</span><span class="token punctuation">,</span> Model <span class="token variable">$item</span> <span class="token operator">=</span> <span class="token constant">null</span><span class="token punctuation">)</span>
</code></pre></div><p>Validation <a href="https://laravel.com/docs/validation#after-validation-hook" target="_blank" rel="noopener noreferrer">After Validation Hook<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>.</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function">validationAfter</span><span class="token punctuation">(</span>\<span class="token package">Illuminate<span class="token punctuation">\</span>Validation<span class="token punctuation">\</span>Validator</span> <span class="token variable">$validator</span><span class="token punctuation">,</span> \<span class="token package">Illuminate<span class="token punctuation">\</span>Http<span class="token punctuation">\</span>Request</span> <span class="token variable">$request</span><span class="token punctuation">,</span> string <span class="token variable">$type</span><span class="token punctuation">,</span> \<span class="token package">Illuminate<span class="token punctuation">\</span>Database<span class="token punctuation">\</span>Eloquent<span class="token punctuation">\</span>Model</span> <span class="token variable">$item</span> <span class="token operator">=</span> <span class="token constant">null</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>
<span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token function">mb_strlen</span><span class="token punctuation">(</span><span class="token variable">$request</span><span class="token operator">-</span><span class="token operator">></span><span class="token function">input</span><span class="token punctuation">(</span><span class="token single-quoted-string string">'name'</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">%</span> <span class="token number">2</span> <span class="token operator">!=</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
<span class="token variable">$validator</span><span class="token operator">-</span><span class="token operator">></span><span class="token function">errors</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">-</span><span class="token operator">></span><span class="token function">add</span><span class="token punctuation">(</span><span class="token single-quoted-string string">'name'</span><span class="token punctuation">,</span> <span class="token single-quoted-string string">'Name length should be even.'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="modifyrequest"><a href="#modifyrequest" class="header-anchor">#</a> modifyRequest</h2> <p>To modify request before save request to model.</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">protected</span> <span class="token keyword">function</span> <span class="token function">modifyRequest</span><span class="token punctuation">(</span>Request <span class="token variable">$request</span><span class="token punctuation">,</span> Model <span class="token variable">$item</span> <span class="token operator">=</span> <span class="token constant">null</span><span class="token punctuation">)</span>
</code></pre></div><div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">protected</span> <span class="token keyword">function</span> <span class="token function">modifyRequest</span><span class="token punctuation">(</span>\<span class="token package">Illuminate<span class="token punctuation">\</span>Http<span class="token punctuation">\</span>Request</span> <span class="token variable">$request</span><span class="token punctuation">,</span> <span class="token operator">?</span>\<span class="token package">Illuminate<span class="token punctuation">\</span>Database<span class="token punctuation">\</span>Eloquent<span class="token punctuation">\</span>Model</span> <span class="token variable">$item</span> <span class="token operator">=</span> <span class="token constant">null</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>
<span class="token variable">$request</span><span class="token operator">-</span><span class="token operator">></span><span class="token function">merge</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token single-quoted-string string">'name'</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token function">trim</span><span class="token punctuation">(</span><span class="token variable">$request</span><span class="token operator">-</span><span class="token operator">></span><span class="token function">input</span><span class="token punctuation">(</span><span class="token single-quoted-string string">'name'</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token single-quoted-string string">'/'</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><p>In above example if user input <code>/test/test/test/</code> as name will converted to <code>test/test/test</code>.</p> <h2 id="modifyresonse"><a href="#modifyresonse" class="header-anchor">#</a> modifyResonse</h2> <div class="language-php extra-class"><pre class="language-php"><code> <span class="token keyword">protected</span> <span class="token keyword">function</span> <span class="token function">modifyResponse</span><span class="token punctuation">(</span>stdClass <span class="token variable">$response</span><span class="token punctuation">,</span> Model <span class="token variable">$item</span><span class="token punctuation">)</span>
</code></pre></div><p>To show object data on form we convert it to a stdClass object.
You can modify it to what ever you want.</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">protected</span> <span class="token keyword">function</span> <span class="token function">modifyResponse</span><span class="token punctuation">(</span>\<span class="token package">stdClass</span> <span class="token variable">$response</span><span class="token punctuation">,</span> \<span class="token package">Illuminate<span class="token punctuation">\</span>Database<span class="token punctuation">\</span>Eloquent<span class="token punctuation">\</span>Model</span> <span class="token variable">$item</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>
<span class="token variable">$response</span><span class="token operator">-</span><span class="token operator">></span><span class="token property">name</span> <span class="token operator">=</span> <span class="token single-quoted-string string">'Edit: '</span><span class="token punctuation">.</span><span class="token variable">$item</span><span class="token operator">-</span><span class="token operator">></span><span class="token property">name</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><p>Above example will prepend 'Edit: ' in name field.</p> <h2 id="model-events"><a href="#model-events" class="header-anchor">#</a> Model Events</h2> <p>You can handle model events with these functions.</p> <ul><li>onRetrieved : Model <code>retrieved</code> event</li> <li>onCreating : Model <code>creating</code> event</li> <li>onCreated : Model <code>created</code> event</li> <li>onUpdating : Model <code>updating</code> event</li> <li>onUpdated : Model <code>updated</code> event</li> <li>onSaving : Model <code>saving</code> event</li> <li>onSaved : Model <code>saved</code> event</li> <li>onDeleting : Model <code>deleting</code> event when not soft deleting</li> <li>onDeleted : Model <code>deleted</code> event when not soft deleted</li> <li>onSoftDeleting : Model <code>deleting</code> event when soft deleting</li> <li>onSoftDeleted : Model <code>creating</code> event when soft deleted</li> <li>onRestoring : Model <code>restoring</code> event when restoring soft delete item</li> <li>onRestored : Model <code>restored</code> event when soft deleted item restored</li> <li>onChanging : Model <code>changing</code> event when any change happening to model</li> <li>onChanged : Model <code>changed</code> event when any change happend to model</li></ul> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">protected</span> <span class="token keyword">function</span> <span class="token function">onChanged</span><span class="token punctuation">(</span>\<span class="token package">Illuminate<span class="token punctuation">\</span>Database<span class="token punctuation">\</span>Eloquent<span class="token punctuation">\</span>Model</span> <span class="token variable">$item</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>
Cache<span class="token punctuation">:</span><span class="token punctuation">:</span><span class="token function">flush</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token keyword">protected</span> <span class="token keyword">function</span> <span class="token function">onSaving</span><span class="token punctuation">(</span>\<span class="token package">Illuminate<span class="token punctuation">\</span>Database<span class="token punctuation">\</span>Eloquent<span class="token punctuation">\</span>Model</span> <span class="token variable">$item</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>
<span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token keyword">empty</span><span class="token punctuation">(</span><span class="token variable">$item</span><span class="token operator">-</span><span class="token operator">></span><span class="token property">name</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
<span class="token variable">$item</span><span class="token operator">-</span><span class="token operator">></span><span class="token property">name</span> <span class="token operator">=</span> <span class="token single-quoted-string string">'Default'</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><p>The above example will clear cached data when any change happened and also will fill the name field with 'Default' value if the user did not fill the name field.</p> <h2 id="other-details"><a href="#other-details" class="header-anchor">#</a> Other Details</h2> <ul><li><a href="/widgets.html">Widgets</a></li> <li><a href="/cards.html">Cards</a></li> <li><a href="/actions.html">Actions</a></li></ul></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/sanjabteam/docs/edit/master/docs/crud.md" target="_blank" rel="noopener noreferrer">Help us improve this page!</a> <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></div> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
←
<a href="/install.html" class="prev">
Installation
</a></span> <span class="next"><a href="/setting.html">
Setting
</a>
→
</span></p></div> </main></div><div class="global-ui"><!----></div></div>
<script src="/assets/js/app.bb080b10.js" defer></script><script src="/assets/js/3.0ca36dc4.js" defer></script><script src="/assets/js/43.dbde9849.js" defer></script>
</body>
</html>