How do I make global helper functions in laravel 5? [duplicate]

Create a new file in your app/Helpers directory name it AnythingHelper.php An example of my helper is : <?php function getDomesticCities() { $result = \App\Package::where(‘type’, ‘=’, ‘domestic’) ->groupBy(‘from_city’) ->get([‘from_city’]); return $result; } generate a service provider for your helper by following command php artisan make:provider HelperServiceProvider in the register function of your newly generated HelperServiceProvider.php … Read more

What do helper and helper_method do?

The method helper_method is to explicitly share some methods defined in the controller to make them available for the view. This is used for any method that you need to access from both controllers and helpers/views (standard helper methods are not available in controllers). e.g. common use case: #application_controller.rb def current_user @current_user ||= User.find_by_id!(session[:user_id]) end … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)