forked from mustafakhaleddev/laravel-atomic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 04fd2b0
Showing
497 changed files
with
83,290 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/.idea | ||
package-lock.json | ||
composer.phar | ||
composer.lock | ||
phpunit.xml | ||
.phpunit.result.cache | ||
.DS_Store | ||
Thumbs.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
MIT License | ||
|
||
Copyright 2019 Mustafa Khaled | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
# Atomic Panel | ||
|
||
![atomic](http://laravel-atomic.mustafakhaled.com/assets/img/panel.png) | ||
|
||
[[toc]] | ||
|
||
# 🚀 Documentation | ||
Atomic Panel Full Documentation [here](http://laravel-atomic.mustafakhaled.com) | ||
|
||
# 💪 Support me | ||
Support me in [Patreon](http://patreon.com/mustafakhaled) to help me keep going | ||
|
||
|
||
## 🔥 Getting Started | ||
Atomic Panel is a beautifully designed administration panel for Laravel. To make you the most productive developer in the galaxy and give your the opportunity to lead the future. | ||
|
||
|
||
## Requirements | ||
|
||
* PHP: `^7.0` | ||
* Laravel: `^5.5` | ||
|
||
|
||
## Installation | ||
|
||
Require this package in the `composer.json` of your Laravel project. This will download the package. | ||
|
||
``` | ||
composer require mustafakhaleddev/laravel-atomic | ||
``` | ||
|
||
Install AtomicPanel | ||
``` | ||
php artisan atomic:install | ||
``` | ||
|
||
Add the ServiceProvider in `config/app.php` | ||
|
||
```php | ||
'providers' => [ | ||
/* | ||
* Package Service Providers... | ||
*/ | ||
App\Providers\AtomicServiceProvider::class, | ||
] | ||
``` | ||
|
||
Published Files with installation | ||
|
||
``` | ||
-app | ||
-Providers | ||
-AtomicServiceProvider.php | ||
__________________________ | ||
-config | ||
-AtomicPanel.php | ||
__________________________ | ||
-public | ||
-vendor | ||
-atomic | ||
__________________________ | ||
-resources | ||
-views | ||
-vendor | ||
-atomic | ||
__________________________ | ||
``` | ||
#### AtomicPanel | ||
to make admin user | ||
```php | ||
php artisan atomic:user | ||
``` | ||
then open `https://yourwebsite.domain/atomic` | ||
|
||
### Authorizing Atomic | ||
Within your `app/Providers/AtomicServiceProvider.php` file, there is a gate method. This authorization gate controls access to Atomic in non-local environments. By default, any user can access the Atomic Panel when the current application environment is local. You are free to modify this gate as needed to restrict access to your Atomic installation: | ||
```php | ||
/** | ||
* Register the Atomic gate. | ||
* | ||
* This gate determines who can access Atomic in non-local environments. | ||
* | ||
* @return void | ||
*/ | ||
protected function gate() | ||
{ | ||
Gate::define('viewAtomic', function ($user) { | ||
return in_array($user->email, [ | ||
'[email protected]' | ||
]); | ||
}); | ||
} | ||
``` | ||
## Usage | ||
|
||
Atomic Panel is the best curd. it works with Laravel Models. | ||
If you don`t want to use laravel models so you can create your own pages. | ||
|
||
## ⏰ 3 steps for best curd | ||
|
||
### ☝ Step 1 | ||
Include `AtomicModel` trait in your model | ||
```php | ||
<?php | ||
|
||
namespace App; | ||
use Illuminate\Database\Eloquent\Model; | ||
use MustafaKhaled\AtomicPanel\AtomicModel; | ||
|
||
class MyModel extends Model | ||
{ | ||
use AtomicModel; | ||
} | ||
``` | ||
|
||
### ☝ Step 2 | ||
Override `AtomicFields()` method in model | ||
```php | ||
<?php | ||
|
||
namespace App; | ||
use Illuminate\Database\Eloquent\Model; | ||
use MustafaKhaled\AtomicPanel\AtomicModel; | ||
|
||
class MyModel extends Model | ||
{ | ||
use AtomicModel; | ||
|
||
public static function AtomicFields() | ||
{ | ||
return []; | ||
} | ||
} | ||
``` | ||
### ☝ Step 3 | ||
Register your curd fields | ||
```php | ||
<?php | ||
|
||
namespace App; | ||
use Illuminate\Database\Eloquent\Model; | ||
use MustafaKhaled\AtomicPanel\AtomicModel; | ||
use MustafaKhaled\AtomicPanel\Fields\ID; | ||
use MustafaKhaled\AtomicPanel\Fields\Text; | ||
use MustafaKhaled\AtomicPanel\Fields\Trix; | ||
|
||
class MyModel extends Model | ||
{ | ||
use AtomicModel; | ||
|
||
public static function AtomicFields() | ||
{ | ||
return [ | ||
ID::make('id', 'id'), | ||
Text::make('Title', 'title'), | ||
Trix::make('Content', 'content'), | ||
]; | ||
} | ||
} | ||
``` | ||
|
||
|
||
## License | ||
|
||
[MIT](LICENSE) © [Mustafa Khaled](https://mustafakhaled.com) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "mustafakhaleddev/laravel-atomic", | ||
"description": "Atomic Admin Panel For Laravel", | ||
"authors": [ | ||
{ | ||
"name": "Mustafa Khaled", | ||
"email": "[email protected]", | ||
"homepage": "https://mustafakhaled.com" | ||
} | ||
], | ||
"keywords": [ | ||
"laravel","Atomic Panel","mustafakhaled","Atomic","Admin Panel","laravel admin","Mustafa Khaled" | ||
], | ||
"license": "MIT", | ||
"require": { | ||
"php": "^7.1.3", | ||
"yajra/laravel-datatables-oracle": "~8.0", | ||
"laracasts/flash": "3.0.2" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"MustafaKhaled\\AtomicPanel\\": "src/" | ||
} | ||
}, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"MustafaKhaled\\AtomicPanel\\AtomicPanelServiceProvider" | ||
], | ||
"aliases": { | ||
} | ||
} | ||
}, | ||
"minimum-stability": "stable" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<?php | ||
|
||
use MustafaKhaled\AtomicPanel\Http\Middleware\Authenticate; | ||
use MustafaKhaled\AtomicPanel\Http\Middleware\Authorize; | ||
use MustafaKhaled\AtomicPanel\Http\Middleware\AtomicServing; | ||
use MustafaKhaled\AtomicPanel\Http\Middleware\DispatchServingAtomicEvent; | ||
use MustafaKhaled\AtomicPanel\Http\Middleware\AtomicPageMiddleware; | ||
|
||
return [ | ||
|
||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Atomic App Name | ||
|-------------------------------------------------------------------------- | ||
| | ||
| This value is the name of your application. This value is used when the | ||
| framework needs to display the name of the application within the UI | ||
| or in other locations. Of course, you're free to change the value. | ||
| | ||
*/ | ||
'name' => 'Atomic Panel', | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Atomic Path | ||
|-------------------------------------------------------------------------- | ||
| | ||
| This is the URI path where Atomic will be accessible from. Feel free to | ||
| change this path to anything you like. | ||
| | ||
*/ | ||
"path" => '/atomic', | ||
|
||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Atomic Authentication Guard | ||
|-------------------------------------------------------------------------- | ||
| | ||
| This configuration option defines the authentication guard that will | ||
| be used to protect your Atomic routes. This option should match one | ||
| of the authentication guards defined in the "auth" config file. | ||
| | ||
*/ | ||
|
||
'guard' => env('ATOMIC_GUARD', null), | ||
|
||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Atomic Route Middleware | ||
|-------------------------------------------------------------------------- | ||
| | ||
| These middleware will be assigned to every Panel route, giving you the | ||
| chance to add your own middleware to this stack or override any of | ||
| the existing middleware. | ||
| | ||
*/ | ||
'middleware' => [ | ||
'web', | ||
Authenticate::class, | ||
DispatchServingAtomicEvent::class, | ||
AtomicServing::class, | ||
Authorize::class, | ||
|
||
], | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Atomic Pages Middleware | ||
|-------------------------------------------------------------------------- | ||
| | ||
| These middleware will be assigned to every Pages route to authorize the page | ||
| giving you the chance to add your own middleware to this stack or override any of | ||
| the existing middleware. | ||
| | ||
*/ | ||
'pageMiddleware' => [ | ||
AtomicPageMiddleware::class | ||
] | ||
]; |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.