A PHP package that provides common Data and Value Objects, that are Laravel castable.

Related tags

Laravel common-casts
Overview

Common Casts

A PHP package that provides common Data and Value Objects, that are Laravel castable.

Installation

composer require juststeveking/common-casts

Usage

Email Object

You can create an Email object like so:

use JustSteveKing\CommonCasts\ValueObjects\Personal\Email;

$email = new Email(
    value: '[email protected]',
);

if ($email->validates()) {
    // perform logic
}

Uuid

You can create a Uuid object like so:

use Illuminate\Support\Str;
use JustSteveKing\CommonCasts\ValueObjects\Identification\Uuid;

$uuid = new Uuid(
    value: Str::uuid()->toString(),
);

if ($uuid->validates()) {
    // perform logic
}

Money

You can create a Uuid object like so:

use JustSteveKing\CommonCasts\ValueObjects\Finance\Money;use Money\Currency;

$money = new Money(
    amount: 10_000,
    currency: new Currency(
        code: 'GBP',
    ),
);

if ($money->validates()) {
    // perform logic
}

$money->get(); // Outputs the formatted money string.
You might also like...
Library that offers Input Filtering based on Annotations for use with Objects. Check out 2.dev for 2.0 pre-release.

DMS Filter Component This library provides a service that can be used to filter object values based on annotations Install Use composer to add DMS\Fil

Ebansos (Electronic Social Assistance) is a web application that provides citizen data management who will receive social assistance to avoid misdirection assistance from public service/government.

E Bansos Ebansos (Electronic Social Assistance) is a web application that provides citizen data management who will receive social assistance to avoid

An opinionated support package for Laravel, that provides flexible and reusable helper methods and traits for commonly used functionality.

Support An opinionated support package for Laravel, that provides flexible and reusable helper methods and traits for commonly used functionality. Ins

Otpify is a Laravel package that provides a simple and elegant way to generate and validate one time passwords.

Laravel Otpify 🔑 Introduction Otpify is a Laravel package that provides a simple and elegant way to generate and validate one time passwords. Install

Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app
Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

Laravel Soulbscription - This package provides a straightforward interface to handle subscriptions and features consumption.

About This package provides a straightforward interface to handle subscriptions and features consumption. Installation You can

Laravel Backup Panel provides a dashboard for spatie/laravel-backup package.
Laravel Backup Panel provides a dashboard for spatie/laravel-backup package.

Laravel Backup Panel Laravel Backup Panel provides a dashboard for spatie/laravel-backup package. It lets you: create a backup (full | only database |

This package provides an integration with FFmpeg for Laravel. Laravel's Filesystem handles the storage of the files.

Laravel FFMpeg This package provides an integration with FFmpeg for Laravel 6.0 and higher. Laravel's Filesystem handles the storage of the files. Lau

27Laracurl Laravel wrapper package for PHP cURL class that provides OOP interface to cURL. [10/27/2015] View Details

Laracurl Laravel cURL Wrapper for Andreas Lutro's OOP cURL Class Installation To install the package, simply add the following to your Laravel install

Owner
Steve McDougall
🎥 https://bit.ly/3z19Gls 🎥 🖋 https://www.juststeveking.uk/ 🖋
Steve McDougall
Cast your Eloquent model attributes to Value Objects with ease.

Laravel Value Objects Cast your Eloquent model attributes to value objects with ease! Requirements This package requires PHP >= 5.4. Using the latest

Red Crystal Code 23 Dec 30, 2022
Foreman is a Laravel scaffolding application that automates common tasks you typically perform with each new Laravel app you create

Foreman is a Laravel scaffolding application that automates common tasks you typically perform with each new Laravel app you create. The directives you want Forman to perform are outlined in a JSON based template file.

Indatus 145 Apr 13, 2022
Tasty TADS 3 recipes for solving common and uncommon problems.

TADS 3 Cookbook Tasty TADS 3 recipes for solving common and uncommon problems when writing interactive fiction. There are two aspects of the TADS 3 Co

Jim Nelson 9 Apr 17, 2022
Laravel Common Password Validator

laravel-common-password-validator Laravel Common Password Validator An optimized and secure validator to check if a given password is too common. By d

WedgeHR 1 Nov 6, 2021
A collection of common algorithms implemented in PHP. The collection is based on "Cracking the Coding Interview" by Gayle Laakmann McDowell

PHPAlgorithms A collection of common algorithms implemented in PHP. The collection is based on "Cracking the Coding Interview" by Gayle Laakmann McDow

Doğan Can Uçar 921 Dec 18, 2022
⚙️Laravel Nova Resource for a simple key/value typed setting

Laravel Nova Resource for a simple key/value typed setting Administer your Laravel Simple Setting in Nova Pre-requisites This Nova resource package re

elipZis 5 Nov 7, 2022
⚙️Simple key/value typed settings for your Laravel app with synchronized json export

Simple key/value typed settings for your Laravel app Create, store and use key/value settings, typed from numbers over dates to array, cached for quic

elipZis 8 Jan 7, 2023
Blacksmith is a code generation tool which automates the creation of common files that you'd typically create for each entity in your application.

Blacksmith is a code generation tool which automates the creation of common files that you'd typically create for each entity in your application.

Indatus 197 Dec 30, 2022
Store and retrieve settings generally or for model objects in Laravel.

Store and retrieve settings generally or for model objects in Laravel. Documentation You can find the detailed documentation here in Laravel Settings

Pharaonic 7 Dec 19, 2022
This package provides extended support for our spatie/enum package in Laravel.

Laravel support for spatie/enum This package provides extended support for our spatie/enum package in Laravel. Installation You can install the packag

Spatie 264 Dec 23, 2022