diff --git a/README.md b/README.md index 4552b0b..c475396 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,14 @@ If you are using Laravel you can use the following code to display the version o Williamug\Versioning\Versioning::tag() // v1.0.0 ``` -You can add the above piece of code in either your controller or blade views. + +#### For Laravel Blade +If you are using Laravel Blade you can use the following code to display the version of your application: +```blade +
+ @app_version() +
+``` ## Testing diff --git a/src/VersioningServiceProvider.php b/src/VersioningServiceProvider.php index 16774ad..6ec80cc 100644 --- a/src/VersioningServiceProvider.php +++ b/src/VersioningServiceProvider.php @@ -11,4 +11,14 @@ public function configurePackage(Package $package): void { $package->name('versioning'); } + + /** + * Bootstrap services. + * + * @return void + */ + public function boot() + { + Blade::directive('app_version', fn ($money) => ""); + } }