PHPackages                             abdursoft/php - 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. [Framework](/categories/framework)
4. /
5. abdursoft/php

ActiveProject[Framework](/categories/framework)

abdursoft/php
=============

abdursoft php mvc framework. Just work with fun. It's supported multiple databases and a new template engine like blade. Now you can easily build your project with this framework. It has default jwt authentication system

1.0.8(1y ago)016MITPHP

Since Aug 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/abdursoft/abs-framework)[ Packagist](https://packagist.org/packages/abdursoft/php)[ RSS](/packages/abdursoft-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (7)Used By (0)

Abdursoft MVC framework base on PHP OOP 8.x
===========================================

[](#abdursoft-mvc-framework-base-on-php-oop-8x)

It's a custom php mvc framework developed by abdursoft.com. It's very easy to use and customizable. Now it's supported many features as like as Laravel and blade template.

We also build a template engin called ABS Template engine that integrated in this framework. It will make your code very simplified and powerful. Now you can use many thing that use on Laravel such as conditions, print, echo, for loop, foreach loop, switch case and so on.

You can also pass the page title, meta tags, custom styles, javascript and so on. More over you can easily use master layout and child component and extend them very easily. This template engin works as OOP architecture.

Before, you run the project, You need to enable some php extension from php.ini file.

`sodium, tidy, zip, xsl,pdo,mysql,pgsql`

Now let's start with Abdursoft Framework.

```
composer create-project abdursoft/php project_name
```

After installing the package update the `composer.json` file content with `example.composer.json` then update the composer

```
composer update
```

If the framework successfully installed on your device then go to the project/app directory. Then open the Karnel file from app\\Karnel.php

```
public static function csrf() {
    return [
        'csrf'    => false,
        'encrypt' => true,
    ];
}

public static function layout() {
    return [
        'minify' => true,
        'mime'   => ['php', 'html', 'htm', 'abs'],
    ];
}
```

Now change the CSRF mode true/false. If you make this true then csrf service will start on the project otherwise it will be disabled

After that you have to change mime types as you want but remember that for other file's extension consistency. If you want a minify text when you go to page-source-view then make minify true otherwise false.

Now you have to set up some required variable on `core\Config\Config.php`

Now make the changes with your preferred data for these variables

```
define( "BASE_URL", 'http://domain.example/' ); //set root directory/domain
define( "SITE_TITLE", 'ABS MVC FRAMEWORK' ); //site name or title
define( "FAV_ICON", BASE_URL . "assets/images/premium.png" ); //site logo
define( 'DEFAULT_KEYWORDS', 'abs mvc developed by abdursoft' ); //Default keywords

define( 'DATABASE_SERVER', 'mysql' ); //supported database mysql,pgsql,mongodb
```

Moreover there is a lot of variable for some special functions and package just update that when you are going to use that package|function.

Lets make some route on the `web/api` file in the `route/web.php` or `route/api.php`

```
Route::get( '', [App::class, 'index'] );

Route::get( '/country', function ( ) {
    $request = new Request();
    echo $request->input('name');
}, ['name'] );

Route::get( '/layout', [App::class, 'layout'] );

Route::group( 'user', function () {
    Route::get( '/profile', [User::class, 'profile'] );
} );

Route::prefix( 'auth' )->group( 'zeroUser', function () {
    Route::post( '/login', [User::class, 'login'] );
} );

Route::withMiddleware( [Authentication::class,'checkAuth'], function () {
    Route::get( '/auth', [App::class, 'auth'] );
} );
```

Now need to create/update the controller class in `app\Controller\`

```
App.php

namespace ABS\Framework\App\Controller;

use ABS\Framework\Core\Files\Files;
use ABS\Framework\System\Processor\Controller;
use ABS\Framework\System\Request\Request;

use function ABS\Framework\System\Helper\view;

class App extends Controller {
    public function __construct() {
        parent::__construct();
    }
    public function index() {
        $this->load->page_title = "Input validation";
        $this->load->view( 'form');
    }

    public function view() {
        return->view( 'form');
    }

    public function layout() {
        $this->metaContent( 'Hello layout', 'Kmn acho tumi' );
        $this->loadStyle('/css/style.css');
        $this->load->view( 'form' );
    }

    public function auth() {
        echo "Welcome to the auth page";
    }
}

```

Now need to create/update the controller class in `app\Controller\`

```
User.php

namespace ABS\Framework\App\Controller;

use ABS\Framework\System\Auth\Auth;
use ABS\Framework\System\Auth\Session;
use ABS\Framework\System\Processor\Controller;
use Exception;

use function ABS\Framework\System\Helper\response;

class User extends Controller {
    public function __construct() {
        parent::__construct();
    }
    public function profile( ) {
        try {
            $user = Auth::jwtDecode( $this->request->input['token'] );
            $this->response( [
                'message' => 'server is ok',
                'data'    => $user,
            ], 200 );
        } catch ( Exception $e ) {
            $this->response( [
                'status'  => 0,
                'message' => $e->getMessage(),
            ], 200 );
        }
    }

    public function login( $param ) {
        if ( !empty( $param ) ) {
            $token = Auth::jwtAUTH( $param, 'users' );
            Session::set( 'jwt_token', $token );
            return response( [
                'message'    => 'Login successful',
                'token'      => $token,
                'token_type' => 'Bearer',
            ], 200 );
        }
    }
}

```

Lets create/update `Authentication.php` middleware file in `app\Middleware` directory.

```
namespace ABS\Framework\App\Middleware;

class Authentication {

    public function checkAuth($callback){
        if('hello' == 'hello'){  // your staff
            call_user_func($callback);
        }
        return;
    }

    // Route::get( '/auth', [App::class, 'auth'] ); this route will protect with the checkAuth middleware function. So you can add your condition and return the callback.
}
```

Now lets run the project for first time.

```
php -S localhost:9000
```

Routing system for the web and api

```
web routes
https://domain.example/path_uri
```

```
api routes
https://domain.example/api/path_uri
```

If the project is running successfully then you can test the all routes. Now time to update the layout page and children component. -First create a components folder/directory in `public/view/` then create some files such as `header.php` and `footer.php` and `layout.php`

```
header.php
header component
```

```
footer.php
Footer Component
```

```
layout.php

    @title@
    @style@
    @script@
    @meta@

    @addView('components/header')
    @import(content)

    @import(body)
    @addView('components/footer')

```

Now lets create a child view/component in `public/view`

```
form.php

@extends('components/layout')
@title(layout page)
@export(body)
Hello text4

    Lorem Text
    Lorem ipsum, dolor sit amet consectetur adipisicing elit. Dignissimos explicabo, quod quibusdam qui accusantium laborum incidunt unde officiis veniam sunt placeat? Nulla illo, molestiae nam ratione numquam quod pariatur quo optio nobis porro unde eius natus quis earum quam in.

    @csrf

@endExport

@export(content)
Content Body
@endExport
```

`@title@` will inherit the page title from controller `@meta@` will inherit the meta content from controller `@style@` will inherit the styles single|array from controller `@script@` will inherit the scripts from controller `@addView(page)` will include `page.php` from `public/view` directory `@import(content)` will receive `@export(content)` from child component `@extend(layout)` will inherit the main `layout` component and data `@export(content)` will export `@export(content)` data from child to layout component `@Session($item)` Will print the session value of the $\_SESSION\[$item\] `@Text($nice)` Will print the multi lang value of $nice `@echo($nice)` Will print the $nice variable `@printf($nice)` Will print the $nice variable `@print_r($nice)` Will print the $nice variable `{{$title}}` will print the `$title` value `{{assets('file_path/file_name)}}` will include the assets file from assets directory `{{storage('file_path/file_name)}}` will include the storage file from storage/uploads directory `{{resource('file_path/file_name)}}` will include the resource file from public/resource directory `{/ php_code /}` execute the all PHP codes without `` starting and ending sign

Others template directives

```
@if('me' === 'me')
    Equal
    @elseif(3==3)
       Else Done
    @else
        Not Equal
@endif

@for($i=0; $i < 10; $i++)
    {{ $i }}
@endfor

@foreach($data as $key)
    {{$key}}
@endforeach

@switch('hello')
    @case(3)
        @echo('nice match')
        @break
    @case(hello)
        @echo('Hello World')
        @break
    @default
        @echo('nothing')
@endswitch
```

&lt;h3&gt;Database and Model&lt;/h3&gt; To create a model file open the directory `app/Model` then make a new php file according your table name. If you have a table name `users` in your database you have to create the model as `Users.php` and the inner content should be

```
namespace ABS\Framework\App\Model;

use ABS\Framework\DB\Model;

class Users extends Model{
    protected static $table;
}
```

You can also change the table with `protected static $table='name_of_the_table'`

&lt;h4&gt;Whats the facility of a model&lt;/h4&gt;

`-Data insert``-Data read``-Data update``-Data delete``-Data aggregate ``-Data joining`

&lt;h4&gt;How to insert data with a model&lt;/h4&gt;

```
Route::post( '/user-create', function ( ) {
    $request = new Request();
    Users::create([
        'name' => $request->input('name'),
        'email' => $request->input('email'),
        'phone' => $request->input('phone'),
        'gender' => $request->input('gender')
    ]);
    echo 'User successfully created';
}, ['name'] );
```

\[N.B\] Users model `use alias` is add your control/route page.

&lt;h4&gt;How to update data with a model&lt;/h4&gt;

```
Route::post( '/user-update', function ( ) {
    $request = new Request();
    Users::where('id','=',1)->update([
        'name' => $request->input('name'),
        'email' => $request->input('email'),
        'phone' => $request->input('phone'),
        'gender' => $request->input('gender')
    ]);
    echo 'User successfully updated';
}, ['name'] );
```

&lt;h4&gt;How to fetch all data from a model for a single user&lt;/h4&gt;

```
Route::post( '/user-get-all-single', function ( ) {
    $request = new Request();
    Users::where($column,$operator,$value)->last();
    echo 'User successfully retrieved';
}, ['name'] );
```

&lt;h4&gt;How to fetch specified data from a model for a single user&lt;/h4&gt;

```
Route::post( '/user-get-specified', function ( ) {
    $request = new Request();
    Users::select(['name','phone'])->where($column,$operator,$value)->last();
    echo 'User successfully retrieved';
}, ['name'] );
```

&lt;h4&gt;How to fetch all data from a model &lt;/h4&gt;

```
Route::post( '/user-get-all', function ( ) {
    $request = new Request();
    Users::where($column,$operator, $value)->get();
    echo 'User successfully retrieved';
}, ['name'] );
```

&lt;h4&gt;How to fetch all data from a model with orderby and limit &lt;/h4&gt;

```
Route::post( '/user-get-oder-all', function ( ) {
    $request = new Request();
    Users::orderBy('id', 'DESC')->where($column,$operator,$value)->limit(3,10)->get();
    echo 'User successfully retrieved';
}, ['name'] );
```

&lt;h4&gt;How to fetch all data from a model with joining &lt;/h4&gt;

```
Route::post( '/user-get-oder-all', function ( ) {
    $request = new Request();
    $all_items = Items::where('item_id','=',42)->leftJoin('item_category','item_category.id','=','items.category_id')->get();
    echo 'Items successfully retrieved';
}, ['name'] );
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 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 ~1 days

Total

5

Last Release

647d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bf66e77a8b88a86dc82e2a95d7805876de54cf544890c6e18bb3598deb0c205d?d=identicon)[abdursoft](/maintainers/abdursoft)

---

Top Contributors

[![abdursoft](https://avatars.githubusercontent.com/u/152814459?v=4)](https://github.com/abdursoft "abdursoft (30 commits)")

### Embed Badge

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

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

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[getkirby/cms

The Kirby core

1.5k535.5k352](/packages/getkirby-cms)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[jelix/jelix

Jelix PHP framework

83101.5k4](/packages/jelix-jelix)

PHPackages © 2026

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