Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the way of maintaining Twill version number #404

Merged
merged 3 commits into from
Oct 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

21 changes: 19 additions & 2 deletions src/TwillServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@

class TwillServiceProvider extends ServiceProvider
{

/**
* The Twill version.
*
* @var string
*/
const VERSION = '1.2.2';

/**
* Service providers to be registered.
*
Expand Down Expand Up @@ -90,7 +98,7 @@ public function register()
'blocks' => Block::class,
]);

config(['twill.version' => trim(file_get_contents(__DIR__ . '/../VERSION'))]);
config(['twill.version' => $this->version()]);
}

/**
Expand Down Expand Up @@ -455,7 +463,6 @@ private function addViewComposers()

return $view->with($with);
});

}

/**
Expand All @@ -470,4 +477,14 @@ private function registerAndPublishTranslations()
$this->loadTranslationsFrom($translationPath, 'twill');
$this->publishes([$translationPath => resource_path('lang/vendor/twill')], 'translations');
}

/**
* Get the version number of Twill.
*
* @return string
*/
public function version()
{
return static::VERSION;
}
}