PHP code example of mohamadtsn / laravel-supernova
1. Go to this page and download the library: Download mohamadtsn/laravel-supernova 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/ */
mohamadtsn / laravel-supernova example snippets
'locale' => 'fa',
use Mohamadtsn\Supernova\Models\User as SupernovaUser; // use supernova User Model
use Mohamadtsn\Supernova\Classes\Traits\PermissionWrapper;
class User extends SupernovaUser
{
use HasApiTokens, HasFactory, Notifiable, PermissionWrapper;
// other class methods
}
protected $fillable = [
'level',
];
class DatabaseSeeder extends Seeder
{
public function run()
{
// Other seeders call
// You add seeders
$this->call(UserSeeder::class); // #1
$this->call(PermissionSeeder::class); // #2
}
}
use App\Http\Middleware\Panel\CheckPermission; // use Middleware class CheckPermission
class Kernel extends HttpKernel
{
protected $routeMiddleware = [
// other routeMiddleware
'permission' => CheckPermission::class, // add CheckPermission::class on this section
];
}
return [
// other configs
'management_url' => env('APP_MANAGEMENT_URL', 'http://management.example.test'),
]
bash
php artisan supernova:publish [tags] --force
bash
php artisan supernova:publish [tags] --force
bash
php artisan migrate:fresh --seed // "Associated with" Drop All Tables & Migrate and seeding
"Or"
php artisan migrate --seed // "Without" Drop All Tables & Migrate and seeding