PHP code example of isproject / framework
1. Go to this page and download the library: Download isproject/framework 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/ */
isproject / framework example snippets
use IsProject\Framework\Concerns\HasRoles;
class User extends Authenticatable
{
use HasFactory, HasRoles, Notifiable;
}
'per_page' => 15,
'per_page_options' => [15, 25, 50, 100],
'max_per_page' => 200,
$table->archivable(); // timestamp('archived_at')->nullable()->index()
Book::query() // active only
Book::withArchived() // active + archived
Book::onlyArchived() // the archive screen's query
use IsProject\Framework\Concerns\Auditable;
class Product extends Model
{
use Auditable;
}
app(AuditRecorder::class)->withoutAuditing(fn () => $seeder->run());
Schedule::command('isproject:audit-prune')->daily(); // keeps audit.retention_days
'select' => ['enabled' => true, 'threshold' => 8],
'manual' => [
'paths' => [resource_path('manual')],
],
isproject_activity('invoice.exported', 'Exported the March invoices', ['count' => 42]);
isproject_activity('order.shipped', 'Marked it shipped', [], $order);
'landing' => ['enabled' => false], // a plain centred card instead
use IsProject\Framework\Concerns\HasRoles;
class User extends Authenticatable
{
use HasRoles;
}
Route::resource('products', ProductController::class)
->middleware(['auth', 'isproject.permission']);
['label' => 'Products', 'route' => 'products.index', 'can' => 'products.index'],
'general' => ['label' => 'General', 'fields' => [
'campus' => ['label' => 'Campus', 'help' => 'Shown on printed reports.'],
'results_public' => ['type' => 'boolean', 'label' => 'Publish results'],
]],
Schema::create('products', function (Blueprint $table) {
$table->id();
$table->foreignId('category_id')->constrained();
$table->string('sku', 32)->unique();
$table->string('name');
$table->text('description')->nullable();
$table->decimal('price', 10, 2);
$table->enum('status', ['draft', 'published', 'archived'])->default('draft');
$table->boolean('is_featured')->default(false);
$table->timestamps();
$table->softDeletes();
});
['heading' => 'Manage'],
['label' => 'Products', 'icon' => 'box', 'route' => 'products.index'],
['label' => 'Reports', 'icon' => 'list', 'can' => 'viewAny', 'children' => [
['label' => 'Monthly', 'route' => 'reports.monthly'],
]],
bash
php artisan make:migration create_products_table
php artisan migrate
php artisan isproject:crud Product
bash
php -v
bash
php artisan serve
bash
composer isproject:install
php artisan migrate
php artisan storage:link
bash
php artisan isproject:user [email protected] --admin
bash
php artisan isproject:crud Product
php artisan isproject:crud Product --table=tbl_products
php artisan isproject:crud Product --only=views,controller --force
php artisan isproject:crud Product --except=policy,routes
bash
php artisan isproject:archivable books # writes the migration
php artisan migrate # you run it
php artisan isproject:crud Book --force # now the module has an archive
bash
php artisan isproject:audit-prune --days=90 --pretend
bash
php artisan isproject:activity-prune --days=90 --pretend
Schedule::command('isproject:activity-prune')->daily();
bash
php artisan isproject:permissions # rescan
php artisan isproject:permissions --admin=Administrator [email protected]
bash
php artisan isproject:install # config + views
php artisan isproject:install --stubs # ...and the generator templates
bash
php artisan vendor:publish --tag=isproject-stubs
bash
php artisan vendor:publish --tag=isproject-config