PHP code example of nextdevit / ndit-dashboard

1. Go to this page and download the library: Download nextdevit/ndit-dashboard 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/ */

    

nextdevit / ndit-dashboard example snippets


'resources' => [
    'products' => [
        'model' => App\Models\Product::class,
        'roles' => ['admin', 'manager'],
        'readonly' => ['viewer'],
        'upload_disk' => 'public',  // Optional: per-resource storage disk
        'upload_directory' => 'products',  // Optional: per-resource directory
        'fields' => [
            'name' => ['type' => 'text', '

use NextDevIT\NditDashboard\Services\AdminNotice;

// Basic usage
AdminNotice::show('Sale ends in 24 hours! <b>Don\'t miss out!</b>');

// Advanced usage with custom styling
AdminNotice::show(
    'Server SSD capacity is critically low (< 5%).',
    '#dc2626', // Red background
    '#ffffff'  // White text
);

// app/Models/Product.php
use NextDevIT\NditDashboard\Concerns\HasCrud;

class Product extends Model
{
    use HasCrud;  // That's it!
    
    protected $fillable = ['name', 'price', 'description'];
}

   use NextDevIT\NditDashboard\Traits\HasProfilePhoto;

   class User extends Authenticatable
   {
       use HasProfilePhoto;
       // ...
   }
   
bash
php artisan ndit-dashboard:install
bash
   php artisan migrate
   
bash
   php artisan storage:link