You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.0 KiB
45 lines
1.0 KiB
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Bootstrap any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
require_once app_path() . '/Helpers/functions.php';
|
|
|
|
// Always redirect to https.
|
|
if($this->app->environment() === 'production') {
|
|
$this->app['request']->server->set('HTTPS', true);
|
|
}
|
|
|
|
\Validator::extend('current_password', function ($attribute, $value, $parameters, $validator) {
|
|
$user = \Auth::user();
|
|
|
|
return $user && \Hash::check($value, $user->password);
|
|
});
|
|
|
|
\Validator::extend('same_password', function ($attribute, $value, $parameters, $validator) {
|
|
$user = \Auth::user();
|
|
|
|
return $user && !\Hash::check($value, $user->password);
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Register any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
//
|
|
}
|
|
}
|