https://github.com/mehedimi/new-instance
Create a new instance of a class and chain method without storing it in a variable.
https://github.com/mehedimi/new-instance
instance php
Last synced: 10 months ago
JSON representation
Create a new instance of a class and chain method without storing it in a variable.
- Host: GitHub
- URL: https://github.com/mehedimi/new-instance
- Owner: mehedimi
- Created: 2021-07-22T06:29:29.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-07-22T06:32:52.000Z (over 4 years ago)
- Last Synced: 2025-01-18T07:46:22.527Z (11 months ago)
- Topics: instance, php
- Language: PHP
- Homepage: https://packagist.org/packages/mehedimi/new-instance
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# New Instance
Create new instance of a class and chain method without storing in variable.
## Installation
To install this package via `composer`, just run the following command on your terminal.
```bash
composer require mehedimi/new-instance
```
## Uses
Just use the `Mehedi\NewInstance\NewInstance` trait in your any PHP class
```php
find();
```
Or you can create singleton instance of any PHP class.
```php