Skip to content

Commit

Permalink
Merge pull request #11 from radiate-framework/bugfix/config-app-key
Browse files Browse the repository at this point in the history
added crypt key to config-app and added helper functions used in configs
  • Loading branch information
BenRutlandWeb authored Sep 30, 2021
2 parents 426b3d0 + 1fa3221 commit 244505a
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 3 deletions.
15 changes: 15 additions & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,19 @@
*/

'asset_url' => get_stylesheet_directory_uri() . '/assets/',

/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/

'key' => env('RADIATE_KEY'),

'cipher' => 'AES-256-CBC',
];
4 changes: 1 addition & 3 deletions config/view.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

use Radiate\Support\Facades\App;

return [
/*
|--------------------------------------------------------------------------
Expand All @@ -12,5 +10,5 @@
|
*/

'path' => App::basePath('views'),
'path' => base_path('resources/views'),
];
37 changes: 37 additions & 0 deletions helpers.php
Original file line number Diff line number Diff line change
@@ -1 +1,38 @@
<?php

use Radiate\Support\Facades\App;

if (!function_exists('base_path')) {
/**
* Get a path from the app base path
*
* @param string $path
* @return string
*/
function base_path(?string $path = null)
{
return App::basePath($path);
}
}

if (!function_exists('env')) {
/**
* Get an "environment" variable with getenv or constant
*
* @param string $key
* @param mixed $default
* @return mixed
*/
function env(string $key, $default = null)
{
if ($env = getenv($key)) {
return $env;
}

if (defined($key)) {
return constant($key);
}

return $default;
}
}

0 comments on commit 244505a

Please sign in to comment.