fooino / core
The fooino core package with tools and functionalities.
dev-main
2026-06-02 12:36 UTC
Requires
- php: ^8.5
- ext-bcmath: *
- ext-intl: *
- morilog/jalali: ^3.5
Requires (Dev)
- orchestra/testbench: ^11.0
- pestphp/pest: ^4.7
- phpdocumentor/shim: ^3.10
This package is auto-updated.
Last update: 2026-06-02 12:37:03 UTC
README
⬇️ Installation
You can install the package
- With composer:
composer require fooino/core
- With Docker(for running and modify the package)
git clone https://github.com/fooino/core.git git clone https://github.com/fooino/laravel-fooino-packages-docker.git cd ./laravel-fooino-packages-docker docker-compose -p fooino up -d --build docker exec -it fooino_php bash cd ../core composer update ./vendor/bin/pest exit
📝 Documentation
# the result will be built at docs/core ./vendor/bin/phpdoc # or composer phpdoc
Facades
-
Json
- Interface
Fooino\Core\Interfaces\Jsonable - Concrete
Fooino\Core\Concretes\JsonManager - Unit test
Fooino\Core\Tests\JsonFacadeUnitTest - Basic Usage
use Fooino\Core\Facades\Json; // To validate a value is json or not | or use isJson() helper Json::is(5); // false Json::is(json_encode(['foo' => 'bar'])); // true // To encode a value to json format | see jsonEncode(), Json::encodePrettified() and jsonEncodePrettified() Json::encode(['foo' => 'bar']); // "{"foo":"bar"}" // To decode a json to the original format | see jsonDecode(), Json::decodeToArray() and jsonDecodeToArray() Json::decode('{"foo":"bar"}' , true); // ['foo' => 'bar'] // To return response to user in json format and standard structure | or use jsonResponse() helper Json::response(status: 200, message: 'ok', errors: ['foo' => 'the foo is required'], data: ['foo' => 'bar'], additional: ['foo' => 'ino'], headers: ['language' => 'fa']) // it returns \Illuminate\Http\JsonResponse
- Interface
-
Date
- Interface
Fooino\Core\Interfaces\Dateable - Concrete
Fooino\Core\Concretes\DateManager - Unit test
Fooino\Core\Tests\DateFacadeUnitTest - Basic Usage
use Fooino\Core\Facades\Date; // return DateTimeZone::listIdentifiers() list that contains ['Asia/Tehran', 'America/New_York', 'UTC', ...] Date::getTimezones(); // validate timezone base on Date::getTimezones() list Date::validateTimezone('Asia/Tehran'); // true Date::validateTimezone('Asia/Fooino'); // false // convert date Date::convert(date: '2022-12-24 19:27:00', format: 'Y-m-d H:i:s', to: 'Asia/Tehran'); // 1401-10-03 22:57:00 Date::convert(date: '2022-12-24 07:27:00 PM', format: 'Y-m-d h:i:s A', to: 'Asia/Tehran'); // 1401-10-03 10:57:00 بعد از ظهر
- Interface
Helpers
nullIfBlank()Returns a fallback value when the input is consideredblankor anull-like stringwhich usually produce by js.nullIfBlankOrZero()Convert value to null when the value is ZERO or blank base onnullIfBlank()removeComma()Remove comma between letters when the value is string or arrayremoveSpace()Remove space between letters when the value is string or arraysanitizeNumber()Remove space and comma from valuereplaceSlashToDash()Replace slashes to dashes when the value is string or arraysetDefaultLocale()andgetDefaultLocale()are getter and setter forapp.localeconfigcurrentDate()andcurrentDateTime()returns date and time inY-m-dandY-m-d H:i:sformatcallMethodIfExists()Safely call a method on an object or class if it exists, otherwise return a fallback value.
🚀 Change log
Please see CHANGELOG for more information about recent changes.
✅ Testing
./vendor/bin/pest # or composer pest
👨💻 Contributing
Please see CONTRIBUTING for details to how contribute.
🐞 Security
If you've found a bug regarding security please mail sajadsholidev@gmail.com
🔥 Credits
⚖️ License
PRIVATE CODE. Please see License File for more information.