I want to set up a system to identify the companies that connect to my web site from their ip address. But once I have the ip addresses of visitors to my site, how do I determine if the visitor is a company or not? I retrieved the ip addresses of visitors in php Answer Try to use : gethostbyaddr
Tag: localization
In Firefox my Text displays perfectly but Chrome says offset in PHP
I have a function in my PHP script which loads the correct localization file based on the locale, which the header sends. In Firefox my Text is displayed perfectly, but when I switch to Chrome it only says “Notice: Trying to access array offset on value of type null in [PATH]/index.php on line 46” My function to load the language
laravel feature tests with locales
I am new to Laravel and I am having an issue to write a test function that asserts that the HTTP response of my welcome page is 200 knowing that I have EN and FR locales defined, meaning that the test should test both localhost:8000/en and localhost:8000/fr. This is my exampletest.php: I don’t like writing the code twice for both
Laravel class translator does not exist in a configuration file
Is there any way that allows inserting translatable value in configuration file in laravel-5.4 application? I have a custom configuration file at config/fox-reports.php and I’m trying to set a translatable configuration value looks like the following: When I run php artisan config:cache the following error is generated: In Container.php line 729: Answer You can’t use the __() helper in config
How to remove route prefix from route actions in Laravel
I am creating localization in Laravel 5.3 application. It must follow such requirements: If route path contains locale prefix, locale should be set according to this prefix If there’s no route prefix,…
Best practice to render Laravel site in other language
Description I have a Laravel site is in English. I want to make it compatible with Dutch also. I start my homepage small, it only contain 3 sentences. which will render this Attempt I’ve installed this Laravel package and did all the installation steps from that repo. My routes, service provider, alias, middleware, resources/lang/ , and the laravellocalization.php are all
Search for country
I have built a web application where you can search for a set of locations. Its a free text field where the visitor can input name, street, city, country, etc. I’m using php and Elasticsearch. The …
Laravel : App::setLocale doesn’t work
I’m using laravel 5.1, I’m trying to update locale in app file like this : In Locale Middleware file : … public function handle($request, Closure $next) { if(Session::has(‘locale’…
Best practice multi language website
I’ve been struggling with this question for quite some months now, but I haven’t been in a situation that I needed to explore all possible options before. Right now, I feel like it’s time to get to know the possibilities and create my own personal preference to use in my upcoming projects. Let me first sketch the situation I’m looking
Date and time in Greek
I’m currently using a website to get the time in Athens: $d = new DateTime(“now”, new DateTimeZone(“Europe/Athens”)); echo $d->format(“l, d M Y”); But I would like the date to be displayed in …