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
/
install.html
84 lines (83 loc) · 21.6 KB
/
install.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
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Installation | 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="Installation">
<meta property="og:type" content="website">
<meta property="og:url" content="/install.html">
<meta name="twitter:title" content="Installation">
<meta name="twitter:url" content="/install.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/45.af6c374b.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/43.dbde9849.js"><link rel="prefetch" href="/assets/js/44.a1a7fab3.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" aria-current="page" class="active sidebar-link">Installation</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/install.html#requirements" class="sidebar-link">Requirements</a></li><li class="sidebar-sub-header"><a href="/install.html#install-using-composer" class="sidebar-link">Install using composer</a></li><li class="sidebar-sub-header"><a href="/install.html#configuration" class="sidebar-link">Configuration</a></li></ul></li><li><a href="/crud.html" class="sidebar-link">CRUD</a></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="installation"><a href="#installation" class="header-anchor">#</a> Installation</h1> <h2 id="requirements"><a href="#requirements" class="header-anchor">#</a> Requirements</h2> <ul><li>PHP 7.2.5+</li> <li>Laravel 6.0</li> <li>Composer</li> <li>NPM and Laravel Mix (optional)</li></ul> <h2 id="install-using-composer"><a href="#install-using-composer" class="header-anchor">#</a> Install using composer</h2> <ol><li><p>Open your laravel project directory in the terminal/CMD.</p></li> <li><p>Use the composer command to install sanjab on your project.</p></li></ol> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">composer</span> require sanjabteam/sanjab
</code></pre></div><ol start="3"><li>Install sanjab using the following command.</li></ol> <div class="language-bash extra-class"><pre class="language-bash"><code>php artisan sanjab:install
</code></pre></div><blockquote><p>Checkout Sanjab\Models\SanjabUser trait added to the User model.</p></blockquote> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">use</span> <span class="token package">Sanjab<span class="token punctuation">\</span>Models<span class="token punctuation">\</span>SanjabUser</span><span class="token punctuation">;</span>
<span class="token keyword">class</span> <span class="token class-name">User</span> <span class="token keyword">extends</span> <span class="token class-name">Authenticatable</span>
<span class="token punctuation">{</span>
<span class="token keyword">use</span> <span class="token package">Notifiable</span><span class="token punctuation">,</span> SanjabUser<span class="token punctuation">;</span>
</code></pre></div><ol start="4"><li>Run migrate command.</li></ol> <div class="language-bash extra-class"><pre class="language-bash"><code>php artisan migrate
</code></pre></div><ol start="5"><li>Create a new user.</li></ol> <div class="language-bash extra-class"><pre class="language-bash"><code>php artisan tinker
Psy Shell v0.9.9 <span class="token punctuation">(</span>PHP <span class="token number">7.2</span>.12 — cli<span class="token punctuation">)</span> by Justin Hileman
<span class="token operator">>></span><span class="token operator">></span> User::create<span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">'email'</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token string">'test@test.com'</span>, <span class="token string">'name'</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token string">'sanjab'</span>, <span class="token string">'password'</span> <span class="token operator">=</span><span class="token operator">></span> bcrypt<span class="token punctuation">(</span><span class="token string">"123456"</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
</code></pre></div><ol start="6"><li>Use the following command to convert created user to sanjab super admin.</li></ol> <div class="language-bash extra-class"><pre class="language-bash"><code>php artisan sanjab:make:admin --user<span class="token operator">=</span>test@test.com
</code></pre></div><blockquote><p>--user is user email. if you want to use something else as username input you need to change the config in config/sanjab.php</p></blockquote> <p><code>php 'login' => [...]</code></p> <ol start="7"><li><p>Open <code>yourwebsite.local/admin</code> to login to the admin panel.</p></li> <li><p>Congratulations! you installed the sanjab admin panel successfully!</p></li></ol> <h2 id="configuration"><a href="#configuration" class="header-anchor">#</a> Configuration</h2> <p>Open <code>config/sanjab.php</code> to change config values.</p> <h3 id="route"><a href="#route" class="header-anchor">#</a> route</h3> <p>Sanjab panel route prefix.</p> <h3 id="controllers"><a href="#controllers" class="header-anchor">#</a> controllers</h3> <p>All sanjab controllers should be here.
if you want to delete a controller or change class name you should update this too.
note that artisan commands like <code>sanjab:make:crud</code> will add controller automatically to this.</p> <h3 id="locales"><a href="#locales" class="header-anchor">#</a> locales</h3> <p>Locales that available for multilingual inputs.
Keys are iso code and values are the label of language.</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token punctuation">[</span>
<span class="token single-quoted-string string">'en'</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token single-quoted-string string">'English'</span><span class="token punctuation">,</span>
<span class="token single-quoted-string string">'fr'</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token single-quoted-string string">'French'</span><span class="token punctuation">,</span>
<span class="token single-quoted-string string">'fa'</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><span class="token punctuation">.</span>
<span class="token punctuation">]</span>
</code></pre></div><h3 id="login"><a href="#login" class="header-anchor">#</a> login</h3> <p>By default, sanjab uses email as a login form input. but if you want to use something else you can change this config.</p> <p>For example, if you want mobile instead of email change like this.</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token single-quoted-string string">'login'</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token punctuation">[</span>
<span class="token single-quoted-string string">'username'</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token single-quoted-string string">'mobile'</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">'Mobile'</span><span class="token punctuation">,</span>
<span class="token punctuation">]</span>
</code></pre></div><p>Also, you can enable/disable ReCaptcha in the login form.</p> <div class="language-php extra-class"><pre class="language-php"><code>
<span class="token single-quoted-string string">'login'</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token punctuation">[</span>
<span class="token single-quoted-string string">'recaptcha'</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token boolean constant">false</span>
<span class="token punctuation">]</span>
</code></pre></div><h3 id="recaptcha"><a href="#recaptcha" class="header-anchor">#</a> ReCaptcha</h3> <p>Before using ReCaptcha you should get your ReCaptcha <code>sitekey</code> and <code>secretkey</code> from <a href="https://www.google.com/recaptcha" target="_blank" rel="noopener noreferrer">Google Recaptcha<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>.
then you should define these in your <code>.env</code> file.</p> <div class="language-env extra-class"><pre class="language-text"><code>RECAPTCHA_SITE_KEY=YOUR SITE KEY HERE
RECAPTCHA_SECRET_KEY=YOUR SECRET KEY HERE
</code></pre></div><p>By default, you don't need to pass ReCaptcha. if you want to disable this feature change <code>ignore_on_debug</code> to <code>false</code>.</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token single-quoted-string string">'recaptcha'</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token punctuation">[</span>
<span class="token single-quoted-string string">'ignore_on_debug'</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token boolean constant">false</span>
<span class="token punctuation">]</span>
</code></pre></div><h3 id="theme"><a href="#theme" class="header-anchor">#</a> theme</h3> <p>Theme settings are here.</p> <ul><li>color: Theme color scheme based on material colors.
Possible values are:'red','pink','purple','deep-purple','indigo','blue', 'light-blue','cyan','teal','green','light-green','lime','yellow', 'amber','orange','deep-orange','brown','grey','blue-grey'
.</li> <li>footer_note: Note in admin footer.</li> <li>footer_links: External links in footer.</li></ul> <div class="language-php extra-class"><pre class="language-php"><code><span class="token single-quoted-string string">'footer_links'</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token punctuation">[</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">'LINK TITLE'</span><span class="token punctuation">,</span> <span class="token single-quoted-string string">'link'</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token single-quoted-string string">'LINK URL'</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
<span class="token punctuation">]</span>
</code></pre></div><h3 id="elfinder"><a href="#elfinder" class="header-anchor">#</a> elfinder</h3> <p><a href="https://github.com/Studio-42/elFinder" target="_blank" rel="noopener noreferrer">Elfinder<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> file manager.</p> <ul><li>enabled: Should file manager be available in sidebar</li> <li>disks: Array of <a href="https://laravel.com/docs/filesystem" target="_blank" rel="noopener noreferrer">disks<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> that should be available in the file manager.</li></ul> <div class="language-php extra-class"><pre class="language-php"><code><span class="token single-quoted-string string">'disks'</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token punctuation">[</span>
<span class="token single-quoted-string string">'public'</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token single-quoted-string string">'Uploads'</span><span class="token punctuation">,</span>
<span class="token single-quoted-string string">'disk_name'</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token single-quoted-string string">'Disk label'</span>
<span class="token punctuation">]</span>
</code></pre></div></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/sanjabteam/docs/edit/master/docs/install.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="/" class="prev router-link-active">
Sanjab
</a></span> <span class="next"><a href="/crud.html">
CRUD
</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/45.af6c374b.js" defer></script>
</body>
</html>