devopstools / laracast-table
A reusable Laravel package for testing, validating, and managing form workflows and validation logic.
dev-main
2026-08-25 09:12 UTC
Requires
- php: ^8.0|^8.1|^8.2|^8.3
- illuminate/console: ^9.0|^10.0|^11.0
- illuminate/routing: ^9.0|^10.0|^11.0
- illuminate/support: ^9.0|^10.0|^11.0
- illuminate/validation: ^9.0|^10.0|^11.0
- illuminate/view: ^9.0|^10.0|^11.0
Requires (Dev)
- orchestra/testbench: ^7.0|^8.0|^9.0
- phpunit/phpunit: ^9.5|^10.0|^11.0
This package is auto-updated.
Last update: 2026-08-25 09:37:49 UTC
README
khan/forms is a reusable Laravel package for querying database records (such as student_fee_managers by date), testing workflows, and validating forms.
๐ Key Features
- Student Fee Manager Date Explorer: Interactive dashboard (
/forms/test) with date picker and search button to retrieve the latest 10 entries fromstudent_fee_managerstable for any particular date. - Direct Query API:
Forms::getStudentFeeEntries($date, 10)to query fee records from any controller or service. - Consistent Validation API: Unified result payload
['passed', 'message', 'errors', 'data']wrapping Laravel's validation engine. - Dynamic Form Registry: Register custom testing closures and handlers anywhere in your application.
- Custom Form Classes: Dedicated form test classes implementing
Khan\Forms\Contracts\FormTest. - Artisan Generator & Runner:
php artisan make:formandphp artisan forms:test. - Zero-Vendor Modifications: Easily extend using Macros, Service Providers, or custom form classes.
๐ Web Interface (Student Fee Manager Date Explorer)
Navigate to:
๐ http://127.0.0.1:8000/forms/test (or http://localhost/new_sls/public/forms/test)
How to Use the Date Explorer:
- Select a date using the date picker (or click quick date buttons: Today, Yesterday, Sample).
- Choose a specific date column (e.g.
created_at,due_date,paid_date,fee_month,issue_date) or keep Auto. - Click "Search Fee Entries".
- The page displays the latest 10 entries from
student_fee_managersin a formatted table with:- Challan / Entry ID
- Student ID
- Title
- Total Amount, Fee, Fine, Discount
- Status (Paid / Unpaid / Pending badges)
- Fee Month, Due Date, Created At
- Toggle the "Raw JSON" viewer to inspect the raw database records.
๐ Programmatic Usage (In PHP / Controllers)
Query Fee Entries by Date
use Khan\Forms\Facades\Forms; // Get latest 10 entries for a specific date $result = Forms::getStudentFeeEntries('2026-06-15', 10); if ($result['passed']) { $records = $result['data']; // Array of database rows $count = $result['count']; // Number of rows found } // Or query any table by date: $result = Forms::fetchLatestByDate('student_fee_managers', '2026-06-15', 10, 'created_at');
๐ฆ Installation & Setup
-
Path Repository in Root
composer.json:"repositories": [ { "type": "path", "url": "packages/khan/forms", "options": { "symlink": true } } ]
-
Composer Installation:
composer require khan/forms:@dev
-
Publish Configuration & Views:
php artisan vendor:publish --tag=forms-config php artisan vendor:publish --tag=forms-views
๐งช Running Automated Tests
php vendor/phpunit/phpunit/phpunit packages/khan/forms/tests
Results:
OK (19 tests, 60 assertions)