diff --git a/README.md b/README.md index 3ac2c03..a324c79 100644 --- a/README.md +++ b/README.md @@ -46,10 +46,10 @@ Examples: `->exact("hello world", false, "1+")` - Remove need for "end" method in BuilderPattern ✔️ - Add Dockblocs and comments for new methods ✔️ -- Add facade for Laravel -- Wrap Builder in class for static start - - "string" and "source" for builder start✔️ - - "start" and "pattern" for builderPattern start✔️ +- Add facade for Laravel ✔️ +- Wrap Builder in class for static start ✔️ + - "string" and "source" for builder start ✔️ + - "start" and "pattern" for builderPattern start ✔️ - Write documentation (add credit for https://regexr.com/ and ChatGPT) - Add automated tests on PR creation or on marging to main branch ✔️ diff --git a/composer.json b/composer.json index 455e7a7..ecab9cd 100644 --- a/composer.json +++ b/composer.json @@ -22,5 +22,15 @@ "allow-plugins": { "pestphp/pest-plugin": true } + }, + "extra": { + "laravel": { + "providers": [ + "Maestroerror\\EloquentRegex\\EloquentRegexServiceProvider" + ], + "aliases": { + "EloquentRegex": "Maestroerror\\EloquentRegex\\Facades\\EloquentRegex" + } + } } } diff --git a/src/EloquentRegexServiceProvider .php b/src/EloquentRegexServiceProvider .php new file mode 100644 index 0000000..b05760a --- /dev/null +++ b/src/EloquentRegexServiceProvider .php @@ -0,0 +1,20 @@ +app->singleton('eloquentregex', function ($app) { + return new \Maestroerror\EloquentRegex\EloquentRegex(); + }); + } + + public function boot() + { + // booting code + } +} diff --git a/src/Facades/EloquentRegex.php b/src/Facades/EloquentRegex.php new file mode 100644 index 0000000..b26fbe8 --- /dev/null +++ b/src/Facades/EloquentRegex.php @@ -0,0 +1,18 @@ +