devopstools/laracast-table

A reusable Laravel package for testing, validating, and managing form workflows and validation logic.

Maintainers

Package info

github.com/alihumza5426/laracast-table

pkg:composer/devopstools/laracast-table

Transparency log

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-08-25 09:12 UTC

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 from student_fee_managers table 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:form and php 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:

  1. Select a date using the date picker (or click quick date buttons: Today, Yesterday, Sample).
  2. Choose a specific date column (e.g. created_at, due_date, paid_date, fee_month, issue_date) or keep Auto.
  3. Click "Search Fee Entries".
  4. The page displays the latest 10 entries from student_fee_managers in 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
  5. 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

  1. Path Repository in Root composer.json:

    "repositories": [
        {
            "type": "path",
            "url": "packages/khan/forms",
            "options": {
                "symlink": true
            }
        }
    ]
  2. Composer Installation:

    composer require khan/forms:@dev
  3. 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)