I have got option to disable/enable registration of users. Where should i store this data? What is the best practise?
I think, that store this little data in DB is not good solution.
Hope you know the concept of Environment Variables
In Laravel its stored in .env.php file
<?php
return [
'user_registration' => 'enable/disable'
];
?>
You can retrieve the value as
$_ENV['user_registration']
And manipulate the function accordingly. For ex. if enable then show the form else hide it from Views
Documentation:
http://laravel.com/docs/4.2/configuration#environment-configuration
In that case, you can just add this line inside your registration function
return redirect()->back();
So, that user will not be able to see registration page. and when you want to enable it again, you can comment the above line and you're good to go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With