Skip to content

Commit

Permalink
init package
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafakhaleddev committed Jan 3, 2019
0 parents commit 04fd2b0
Show file tree
Hide file tree
Showing 497 changed files with 83,290 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
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
9 changes: 9 additions & 0 deletions LICENSE
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.
166 changes: 166 additions & 0 deletions README.md
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)
35 changes: 35 additions & 0 deletions composer.json
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"
}
82 changes: 82 additions & 0 deletions config/AtomicPanel.php
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
]
];
5 changes: 5 additions & 0 deletions public/bootstrap/dist/css/bootstrap-rtl.min.css

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions public/bootstrap/dist/css/bootstrap-theme.min.css

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions public/bootstrap/dist/css/bootstrap.min.css

Large diffs are not rendered by default.

Binary file not shown.
Loading

0 comments on commit 04fd2b0

Please sign in to comment.