PHP code example of mustafakhaleddev / laravel-atomic

1. Go to this page and download the library: Download mustafakhaleddev/laravel-atomic library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mustafakhaleddev / laravel-atomic example snippets


'providers' => [
    /*
     * Package Service Providers...
     */
     App\Providers\AtomicServiceProvider::class,
]

php artisan atomic:user

    /**
     * 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]'
            ]);
        });
    }



namespace App;
use Illuminate\Database\Eloquent\Model;
use MustafaKhaled\AtomicPanel\AtomicModel;

class MyModel extends Model
{
    use AtomicModel;
}



namespace App;
use Illuminate\Database\Eloquent\Model;
use MustafaKhaled\AtomicPanel\AtomicModel;

class MyModel extends Model
{
     use AtomicModel;
     
     public static function AtomicFields()
     {
          return [];   
     }
}



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'),
         ];
     }
}

php artisan atomic:install

-app
   -Providers
     -AtomicServiceProvider.php
__________________________
-config
     -AtomicPanel.php
__________________________
-public
     -vendor
       -atomic
__________________________
-resources
     -views
        -vendor
          -atomic
__________________________