PHPackages                             canvastack/canvastack - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. canvastack/canvastack

ActiveLibrary[Security](/categories/security)

canvastack/canvastack
=====================

Comprehensive Laravel library for building fast, secure, accessible, and maintainable web applications — featuring Form Builder, DataTables, Charts, and more.

20PHPCI failing

Since May 21Pushed 1mo agoCompare

[ Source](https://github.com/canvastack/canvastack)[ Packagist](https://packagist.org/packages/canvastack/canvastack)[ RSS](/packages/canvastack-canvastack/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (6)Versions (11)Used By (0)

بِسْمِ ٱللَّٰهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ

وَٱعْتَصِمُوا۟ بِحَبْلِ ٱللَّهِ

CanvaStack
==========

[](#canvastack)

[![Canvastack Logo](https://avatars.githubusercontent.com/u/86165096?s=256&v=4)](https://avatars.githubusercontent.com/u/86165096?s=256&v=4)

**Alhamdulillah** - In the name of Allah SWT, this library has been developed piece by piece since March 29, 2017.

A comprehensive Laravel library for building secure, accessible, and maintainable web applications. Inspired by Muntilan-CMS developed by [.::bit](https://www.limabit.com).

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![Laravel](https://camo.githubusercontent.com/3553418af151b6a058f58453a2030e89d42635553362365169906dcf9fb4c141/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d382e78253230253743253230392e7825323025374325323031302e782d7265642e737667)](https://laravel.com)[![PHP](https://camo.githubusercontent.com/d4b5fa4adf514144779a7864904c5e15236c0e798635240c7f6ce9a455657b80/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e302532422d626c75652e737667)](https://php.net)[![Version](https://camo.githubusercontent.com/5ab1ae5edf9ac00325eaf49a037fa72f85ff8b12264959c652a5f7a08257be73/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d302e312e302d2d616c7068612d6f72616e67652e737667)](CHANGELOG.md)[![Total Downloads](https://camo.githubusercontent.com/e904789d138124fba6a89f7feede1e3e56e24c310231115a9d87403c00d1202a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63616e7661737461636b2f63616e7661737461636b)](https://packagist.org/packages/canvastack/canvastack)

🌟 Features
----------

[](#-features)

### 🔒 Security First

[](#-security-first)

- **XSS Protection**: Automatic HTML escaping for all user input
- **File Upload Security**: Multi-layer validation (extension, MIME type, size, path traversal)
- **SQL Injection Prevention**: Encrypted queries with integrity checking
- **CSRF Protection**: Automatic token generation and validation
- **Path Traversal Protection**: Secure file path validation
- **Input Validation**: Dangerous attribute blocking (onclick, onerror, etc.)

### ♿ Accessibility (WCAG 2.1 Level A)

[](#-accessibility-wcag-21-level-a)

- **ARIA Attributes**: Full support for screen readers
- **Keyboard Navigation**: Complete keyboard accessibility
- **Label Associations**: Proper label-input relationships
- **Required Field Indicators**: Both visual and semantic markers
- **Error Announcements**: Accessible validation messages

### 🎨 Form Builder

[](#-form-builder)

- **Intuitive API**: Fluent interface for form generation
- **Model Binding**: Automatic value population from Eloquent models
- **Validation Integration**: Server-side rules propagate to client-side
- **File Uploads**: Secure file handling with thumbnail generation
- **AJAX Relational Fields**: Dynamic dependent dropdowns
- **Tab Navigation**: Accessible tab components

### 📊 DataTables Integration

[](#-datatables-integration)

- **Server-Side Processing**: Efficient handling of large datasets
- **Search &amp; Filter**: Advanced search capabilities
- **Export Functions**: Export to Excel, PDF, CSV
- **Responsive Design**: Mobile-friendly tables
- **Custom Actions**: Flexible action buttons

### 📈 Chart Components

[](#-chart-components)

- **Multiple Chart Types**: Line, bar, pie, doughnut, radar
- **Interactive**: Hover tooltips and click events
- **Responsive**: Auto-resize on window changes
- **Customizable**: Full control over colors, labels, and options

### 🛠️ Developer Experience

[](#️-developer-experience)

- **Type Hints**: Complete PHP 8.0+ type declarations
- **PHPDoc**: Comprehensive documentation
- **IDE Support**: Full autocomplete support
- **Constants**: No magic strings
- **Error Handling**: Descriptive exceptions with context

📋 Requirements
--------------

[](#-requirements)

- PHP 8.0 or higher
- Laravel 8.x, 9.x, or 10.x
- MySQL 5.7+ or PostgreSQL 9.6+
- PHP Extensions:
    - fileinfo (for MIME type detection)
    - gd or imagick (for image processing)
    - openssl (for encryption)

🚀 Installation
--------------

[](#-installation)

### Step 1: Install Laravel

[](#step-1-install-laravel)

```
composer create-project --prefer-dist laravel/laravel:^10.0 myapp
cd myapp
```

### Step 2: Install CanvaStack

[](#step-2-install-canvastack)

**Option A: Via Composer (Recommended)**

```
composer require canvastack/canvastack
```

**Option B: Via composer.json**

Add to your `composer.json`:

```
{
    "require": {
        "canvastack/canvastack": "^0.1"
    },
    "repositories": [{
        "type": "vcs",
        "url": "git@github.com:canvastack/canvastack.git"
    }]
}
```

Then run:

```
composer update
```

### Step 3: Publish Assets

[](#step-3-publish-assets)

```
php artisan vendor:publish --provider="Canvastack\Canvastack\CanvastackServiceProvider" --force
```

This will publish:

- Configuration files to `config/`
- Migrations to `database/migrations/`
- Assets to `public/vendor/canvastack/`
- Views to `resources/views/vendor/canvastack/`

### Step 4: Configure Database

[](#step-4-configure-database)

1. Update `.env` file:

```
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database_name
DB_USERNAME=your_username
DB_PASSWORD=your_password
```

2. Create database:

```
mysql -u root -p
CREATE DATABASE your_database_name;
exit;
```

### Step 5: Run Migrations

[](#step-5-run-migrations)

```
php artisan migrate:fresh --seed
```

### Step 6: Configure Base URL

[](#step-6-configure-base-url)

Edit `config/canvastack.php` and set your base URL:

```
'base_url' => env('APP_URL', 'http://localhost'),
```

### Step 7: Access Application

[](#step-7-access-application)

**Default Credentials:**

- URL: `http://localhost/myapp/public`
- Email: `admin@gmail.com`
- Password: `@admin`

**Demo Site:** [demo.canvastack.com](https://demo.canvastack.com/login)

📖 Quick Start
-------------

[](#-quick-start)

### Basic Form Example

[](#basic-form-example)

```
use Canvastack\Canvastack\Library\Components\Form\Objects;

$form = new Objects();

// Open form
$form->open('/users/store', 'POST');

// Add fields
$form->text('username', null, [], true);
$form->email('email', null, [], true);
$form->password('password', [], true);

// Close with submit button
$form->close();
```

### Form with Validation

[](#form-with-validation)

```
$form->setValidations([
    'username' => 'required|min:3|max:50',
    'email' => 'required|email|unique:users',
    'age' => 'required|numeric|min:18'
]);

$form->open('/users/store', 'POST');
$form->text('username');
$form->email('email');
$form->number('age');
$form->close();
```

### Edit Form with Model Binding

[](#edit-form-with-model-binding)

```
$user = User::find($id);

$form->model($user, false, "/users/{$id}");
$form->text('name');
$form->email('email');
$form->textarea('bio');
$form->close();
```

### File Upload Form

[](#file-upload-form)

```
$form->open('/profile/update', 'POST', 'horizontal', true);
$form->file('avatar', ['imagepreview'], true);
$form->text('bio');
$form->close();
```

### DataTable Example

[](#datatable-example)

```
use Canvastack\Canvastack\Library\Components\Table\DataTables;

$table = new DataTables();
$table->setModel(User::class);
$table->setColumns(['id', 'name', 'email', 'created_at']);
$table->setSearchable(['name', 'email']);
$table->render();
```

📚 Documentation
---------------

[](#-documentation)

Comprehensive documentation is available in the `docs/` directory:

- **[Form Builder API Reference](docs/COMPONENTS/FORM/API_REFERENCE.md)** - Complete API documentation
- **[Objects Class](docs/COMPONENTS/FORM/OBJECTS_CLASS.md)** - Main form class methods
- **[Element Traits](docs/COMPONENTS/FORM/ELEMENT_TRAITS.md)** - Form element components
- **[Security Guidelines](docs/COMPONENTS/FORM/SECURITY.md)** - Security best practices
- **[Accessibility Guidelines](docs/COMPONENTS/FORM/ACCESSIBILITY.md)** - WCAG compliance guide
- **[FormConstants](docs/COMPONENTS/FORM/FORMCONSTANTS.md)** - Available constants
- **[Migration Guide](docs/COMPONENTS/FORM/MIGRATION_GUIDE.md)** - Upgrade instructions

🔧 Configuration
---------------

[](#-configuration)

### File Upload Configuration

[](#file-upload-configuration)

```
// config/canvastack.php
'file_upload' => [
    'max_size' => 10485760, // 10MB
    'allowed_extensions' => ['jpg', 'jpeg', 'png', 'gif', 'pdf', 'doc', 'docx'],
    'allowed_mime_types' => ['image/jpeg', 'image/png', 'application/pdf'],
    'upload_path' => 'uploads/',
    'generate_thumbnails' => true,
    'thumbnail_size' => [150, 150]
],
```

### Security Configuration

[](#security-configuration)

```
'security' => [
    'enable_xss_protection' => true,
    'enable_csrf_protection' => true,
    'enable_file_validation' => true,
    'enable_path_validation' => true,
    'log_security_events' => true
],
```

🧪 Testing
---------

[](#-testing)

Run the test suite:

```
# Unit tests
./vendor/bin/phpunit

# Property-based tests
./vendor/bin/phpunit --testsuite=PropertyBased

# Security tests
./vendor/bin/phpunit --testsuite=Security

# Accessibility tests
./vendor/bin/phpunit --testsuite=Accessibility
```

🔐 Security
----------

[](#-security)

### Reporting Security Issues

[](#reporting-security-issues)

If you discover a security vulnerability, please email: ****

Do not create public GitHub issues for security vulnerabilities.

### Security Features

[](#security-features)

- ✅ XSS Protection (automatic HTML escaping)
- ✅ SQL Injection Prevention (parameterized queries)
- ✅ CSRF Protection (automatic token generation)
- ✅ File Upload Security (multi-layer validation)
- ✅ Path Traversal Protection (secure path validation)
- ✅ Input Validation (dangerous attribute blocking)
- ✅ Encryption Security (integrity checking)
- ✅ Security Logging (audit trail)

📊 Package Components
--------------------

[](#-package-components)

### Core Components

[](#core-components)

ComponentDescriptionDocumentation**Form Builder**Secure form generation with validation[docs/COMPONENTS/FORM/](docs/COMPONENTS/FORM/)**DataTables**Server-side table processing[docs/COMPONENTS/TABLE/](docs/COMPONENTS/TABLE/)**Charts**Interactive chart componentsComing soon**Template Engine**Layout and theme managementComing soon**Meta Tags**SEO optimization helpersComing soon**Scripts Manager**JavaScript asset managementComing soon### Helper Functions

[](#helper-functions)

HelperPurposeExample`canvastack_form_escape_html()`Escape HTML for XSS protection`canvastack_form_escape_html($input)``canvastack_form_validate_file_extension()`Validate file extensions`canvastack_form_validate_file_extension($file, ['jpg', 'png'])``canvastack_form_validate_path()`Validate file paths`canvastack_form_validate_path($path, $baseDir)``canvastack_form_validate_attributes()`Validate HTML attributes`canvastack_form_validate_attributes($attrs)``canvastack_mail_config_service()`Get MailConfigService instance`canvastack_mail_config_service()``canvastack_mail_test_smtp()`Test SMTP connection`canvastack_mail_test_smtp()`🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details on:

- Code of Conduct
- Development setup
- Coding standards
- Pull request process
- Testing requirements

📝 Changelog
-----------

[](#-changelog)

See [CHANGELOG.md](CHANGELOG.md) for version history.

> Previously released as `canvastack/origin`. Legacy history available in [docs/CHANGELOG/CHANGELOG-legacy-origin.md](docs/CHANGELOG/CHANGELOG-legacy-origin.md).

📄 License
---------

[](#-license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

👥 Credits
---------

[](#-credits)

### Author

[](#author)

- **wisnuwidi** -
- **CanvaStack** -

### Inspiration

[](#inspiration)

- **Muntilan-CMS** by [.::bit](https://www.limabit.com)

### Contributors

[](#contributors)

- All contributors who have helped improve this library

🙏 Acknowledgments
-----------------

[](#-acknowledgments)

**Alhamdulillah** - All praise is due to Allah SWT for making this project possible.

Special thanks to:

- The Laravel community
- All open-source contributors
- Everyone who has provided feedback and suggestions

📞 Support
---------

[](#-support)

- **Documentation**: [docs/](docs/)
- **Issues**: [GitHub Issues](https://github.com/canvastack/canvastack/issues)
- **Email**:
- **Demo**: [demo.canvastack.com](https://demo.canvastack.com)

---

**Made with ❤️ by the Canvastack Team**

*"Simplifying Laravel development, one component at a time."*

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance60

Regular maintenance activity

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~20 days

Recently: every ~4 days

Total

7

Last Release

289d ago

Major Versions

v1.x-dev → v2.0.02025-09-02

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/218853734?v=4)[CanvaStack](/maintainers/canvastack)[@canvastack](https://github.com/canvastack)

---

Top Contributors

[![wisnuwidi](https://avatars.githubusercontent.com/u/169636?v=4)](https://github.com/wisnuwidi "wisnuwidi (12 commits)")

### Embed Badge

![Health badge](/badges/canvastack-canvastack/health.svg)

```
[![Health](https://phpackages.com/badges/canvastack-canvastack/health.svg)](https://phpackages.com/packages/canvastack-canvastack)
```

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[bagisto/bagisto

Bagisto Laravel E-Commerce

27.6k172.1k9](/packages/bagisto-bagisto)[october/rain

October Rain Library

1601.7M83](/packages/october-rain)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[eveseat/web

SeAT Web Interface

2623.5k158](/packages/eveseat-web)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
