Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions laravel12_filament4/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
APP_NAME="OV500 Laravel Filament"
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost

APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US

LOG_CHANNEL=stack
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=switch
DB_USERNAME=root
DB_PASSWORD=

KAMAILIO_DB_CONNECTION=kamailio
KAMAILIO_DB_DATABASE=kamailio
CDR_DB_CONNECTION=switchcdr
CDR_DB_DATABASE=switchcdr

SESSION_DRIVER=database
SESSION_LIFETIME=120
CACHE_STORE=database
QUEUE_CONNECTION=database

MAIL_MAILER=log
MAIL_FROM_ADDRESS="noreply@example.com"
MAIL_FROM_NAME="${APP_NAME}"

VITE_APP_NAME="${APP_NAME}"
12 changes: 12 additions & 0 deletions laravel12_filament4/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/vendor
/node_modules
/.env
/.env.backup
/.phpunit.result.cache
/Homestead.json
/Homestead.yaml
/auth.json
/npm-debug.log
/yarn-error.log
/storage/*.key
/public/build
47 changes: 47 additions & 0 deletions laravel12_filament4/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# OV500 Laravel 12 + Filament 4 Portal Scaffold

This directory is a Laravel 12 / Filament 4 rebuild target for the legacy OV500 CodeIgniter portal. It is designed for an incremental migration: keep the existing SQL dumps in `../config/database`, import them into MariaDB/MySQL, and point this application at those databases.

## What is included

- Laravel 12 application skeleton and Composer/NPM manifests.
- Filament 4 admin panel registered at `/admin`.
- Multi-database connection placeholders for `switch`, `kamailio`, and `switchcdr`.
- Eloquent models and Filament CRUD resources for the first OV500 business modules:
- Customers
- Resellers
- Carriers
- Customer SIP accounts
- Customer rates
- Carrier rates
- DID inventory
- Invoices
- Tickets

## Setup

```bash
cd laravel12_filament4
composer install
cp .env.example .env
php artisan key:generate
php artisan filament:install --panels
php artisan make:filament-user
npm install
npm run build
php artisan serve
```

> Note: this repository environment could not reach Packagist through the configured proxy, so dependencies were not installed here. Run the commands above in an environment with normal Composer network access.

## Database migration path

1. Import the legacy schemas from `../config/database/switch.sql`, `../config/database/kamailio.sql`, and `../config/database/switchcdr.sql`.
2. Configure `.env` with the `DB_*`, `KAMAILIO_DB_*`, and `CDR_DB_*` credentials.
3. Validate each Filament resource against live data and then migrate module-specific business logic from `../portal/application/modules`.
4. Add Laravel migrations only after the legacy schema is stabilized or replaced.

## Compatibility notes

- Filament 4 requires Laravel 11.28+ and PHP 8.2+, and this scaffold pins Laravel Framework `^12.0` with Filament `^4.0`.
- The legacy OV500 tables use non-standard timestamp and primary-key names, so each model explicitly declares table, key, timestamp, and guarded/fillable behavior.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace App\Filament\Resources\BillInvoices;

use App\Filament\Resources\BillInvoices\Pages;
use App\Filament\Resources\BillInvoices\Schemas\BillInvoiceForm;
use App\Filament\Resources\BillInvoices\Tables\BillInvoicesTable;
use App\Models\BillInvoice;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Tables\Table;

class BillInvoiceResource extends Resource
{
protected static ?string $model = BillInvoice::class;

protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-document-currency-dollar';

protected static string|\UnitEnum|null $navigationGroup = 'Billing';

protected static ?string $recordTitleAttribute = 'invoice_id';

public static function form(Schema $schema): Schema
{
return BillInvoiceForm::configure($schema);
}

public static function table(Table $table): Table
{
return BillInvoicesTable::configure($table);
}

public static function getPages(): array
{
return [
'index' => Pages\ListBillInvoices::route('/'),
'create' => Pages\CreateBillInvoice::route('/create'),
'edit' => Pages\EditBillInvoice::route('/{record}/edit'),
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace App\Filament\Resources\BillInvoices\Pages;

use App\Filament\Resources\BillInvoices\BillInvoiceResource;
use Filament\Resources\Pages\CreateRecord;

class CreateBillInvoice extends CreateRecord
{
protected static string $resource = BillInvoiceResource::class;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace App\Filament\Resources\BillInvoices\Pages;

use App\Filament\Resources\BillInvoices\BillInvoiceResource;
use Filament\Actions\DeleteAction;
use Filament\Resources\Pages\EditRecord;

class EditBillInvoice extends EditRecord
{
protected static string $resource = BillInvoiceResource::class;

protected function getHeaderActions(): array
{
return [
DeleteAction::make(),
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace App\Filament\Resources\BillInvoices\Pages;

use App\Filament\Resources\BillInvoices\BillInvoiceResource;
use Filament\Actions\CreateAction;
use Filament\Resources\Pages\ListRecords;

class ListBillInvoices extends ListRecords
{
protected static string $resource = BillInvoiceResource::class;

protected function getHeaderActions(): array
{
return [
CreateAction::make(),
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace App\Filament\Resources\BillInvoices\Schemas;

use Filament\Forms\Components\DateTimePicker;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Schema;

class BillInvoiceForm
{
public static function configure(Schema $schema): Schema
{
return $schema
->components([
TextInput::make('invoice_id')->label('Invoice Id')->required()->maxLength(255),
TextInput::make('account_id')->label('Account Id')->required()->maxLength(255),
TextInput::make('company_name')->label('Company Name')->maxLength(255),
Textarea::make('email_address')->label('Email Address')->columnSpanFull(),
TextInput::make('phone_number')->label('Phone Number')->maxLength(255),
DateTimePicker::make('bill_date')->label('Bill Date'),
Select::make('billing_cycle')->label('Billing Cycle')->options(['weekly' => 'weekly', 'monthly' => 'monthly', 'MONTHLY' => 'MONTHLY', 'DAILY' => 'DAILY', 'WEEKLY' => 'WEEKLY']),
TextInput::make('payment_terms')->label('Payment Terms')->maxLength(255),
DateTimePicker::make('next_billing_date')->label('Next Billing Date'),
DateTimePicker::make('billing_date_from')->label('Billing Date From'),
DateTimePicker::make('billing_date_to')->label('Billing Date To'),
TextInput::make('last_bill_amount')->label('Last Bill Amount')->maxLength(255),
TextInput::make('currency_symbol')->label('Currency Symbol')->maxLength(255),
TextInput::make('payments')->label('Payments')->maxLength(255),
]);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

namespace App\Filament\Resources\BillInvoices\Tables;

use Filament\Actions\BulkActionGroup;
use Filament\Actions\DeleteBulkAction;
use Filament\Actions\EditAction;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;

class BillInvoicesTable
{
public static function configure(Table $table): Table
{
return $table
->columns([
TextColumn::make('id')->label('Id')->sortable()->searchable(),
TextColumn::make('invoice_id')->label('Invoice Id')->sortable()->searchable(),
TextColumn::make('account_id')->label('Account Id')->sortable()->searchable(),
TextColumn::make('company_name')->label('Company Name')->sortable()->searchable(),
TextColumn::make('email_address')->label('Email Address')->sortable()->searchable(),
TextColumn::make('phone_number')->label('Phone Number')->sortable()->searchable(),
TextColumn::make('bill_date')->label('Bill Date')->dateTime()->sortable(),
TextColumn::make('billing_cycle')->label('Billing Cycle')->sortable()->searchable(),
])
->filters([
// Add module-specific filters during the next migration pass.
])
->recordActions([
EditAction::make(),
])
->toolbarActions([
BulkActionGroup::make([
DeleteBulkAction::make(),
]),
]);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace App\Filament\Resources\CarrierRates;

use App\Filament\Resources\CarrierRates\Pages;
use App\Filament\Resources\CarrierRates\Schemas\CarrierRateForm;
use App\Filament\Resources\CarrierRates\Tables\CarrierRatesTable;
use App\Models\CarrierRate;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Tables\Table;

class CarrierRateResource extends Resource
{
protected static ?string $model = CarrierRate::class;

protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-banknotes';

protected static string|\UnitEnum|null $navigationGroup = 'Rating';

protected static ?string $recordTitleAttribute = 'destination';

public static function form(Schema $schema): Schema
{
return CarrierRateForm::configure($schema);
}

public static function table(Table $table): Table
{
return CarrierRatesTable::configure($table);
}

public static function getPages(): array
{
return [
'index' => Pages\ListCarrierRates::route('/'),
'create' => Pages\CreateCarrierRate::route('/create'),
'edit' => Pages\EditCarrierRate::route('/{record}/edit'),
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace App\Filament\Resources\CarrierRates\Pages;

use App\Filament\Resources\CarrierRates\CarrierRateResource;
use Filament\Resources\Pages\CreateRecord;

class CreateCarrierRate extends CreateRecord
{
protected static string $resource = CarrierRateResource::class;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace App\Filament\Resources\CarrierRates\Pages;

use App\Filament\Resources\CarrierRates\CarrierRateResource;
use Filament\Actions\DeleteAction;
use Filament\Resources\Pages\EditRecord;

class EditCarrierRate extends EditRecord
{
protected static string $resource = CarrierRateResource::class;

protected function getHeaderActions(): array
{
return [
DeleteAction::make(),
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace App\Filament\Resources\CarrierRates\Pages;

use App\Filament\Resources\CarrierRates\CarrierRateResource;
use Filament\Actions\CreateAction;
use Filament\Resources\Pages\ListRecords;

class ListCarrierRates extends ListRecords
{
protected static string $resource = CarrierRateResource::class;

protected function getHeaderActions(): array
{
return [
CreateAction::make(),
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace App\Filament\Resources\CarrierRates\Schemas;

use Filament\Forms\Components\DateTimePicker;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Schema;

class CarrierRateForm
{
public static function configure(Schema $schema): Schema
{
return $schema
->components([
TextInput::make('ratecard_id')->label('Ratecard Id')->required()->maxLength(255),
TextInput::make('prefix')->label('Prefix')->required()->maxLength(255),
TextInput::make('destination')->label('Destination')->required()->maxLength(255),
TextInput::make('setup_charge')->label('Setup Charge')->maxLength(255),
TextInput::make('rental')->label('Rental')->maxLength(255),
TextInput::make('rate')->label('Rate')->maxLength(255),
TextInput::make('connection_charge')->label('Connection Charge')->maxLength(255),
TextInput::make('minimal_time')->label('Minimal Time')->maxLength(255),
TextInput::make('resolution_time')->label('Resolution Time')->maxLength(255),
Select::make('rates_status')->label('Rates Status')->options(['0' => '0', '1' => '1']),
TextInput::make('account_id')->label('Account Id')->required()->maxLength(255),
]);
}
}
Loading