Working on my first Laravel 5 project and not sure where or how to place logic to force HTTPS on my app. The clincher here is that there are many domains pointing to the app and only two out of three …
Tag: php
laravel search multiple words separated by space
I am new to laravel query builder, I want to search multiple words entered in an input field for example if I type “jhon doe” I want to get any column that contains jhon or doe I have seen/tried solutions using php MySQL but can’t able to adapt to query builder how do I do this using query b…
PHP: How to block the http referer for an image request?
Due to hotlink protection I’m having difficulty displaying images. The http request send in order to obtain the images contains a non empty referer header. This causes the hotlink protection to kick in. Using a referer control tool, I can block the referer, which bypasses hotlink protection. However now…
Mkdir do not create folder and no Errors shown. (PHP) [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 7 years ago. Improve this question I need some help with mkdir in my .php file. It’s not creating the d…
Laravel “artisan make:observer” fails
I am trying to generate a provider using Artisan as described on the documentation page [1] by running: php artisan make:observer AdServiceProvider However I get the following error: […
Custom pagination view in Laravel 5
Laravel 4.2 has the option to specify a custom view in app/config/view.php such as: This is gone in Laravel 5 at least regarding view.php. Is there a way to replicate this behavior in Laravel 5? Answer Whereas in Laravel 4.2 I would use: In Laravel 5 you can replicate the above with the following: Now in the …
Difference between method calls $model->relation(); and $model->relation;
There is some basic understanding/theory here that I am missing.I don’t understand the difference between these function calls: What I am trying to accomplis here is to get a list of the distributors for a store (a many to many relationship), and they get each distributors list of beers into one giant l…
PHPUnit: “Class ‘Eloquent’ not found” when using @dataProvider
I’m running into an issue when writing unit tests with PHPUnit using @dataProvider in a Laravel app. The error I’m receiving is: PHP Fatal error: Class ‘Eloquent’ not found in /path/to/project/app/…
Laravel 5 not finding css files
I’ve just installed a Laravel 5 project on MAMP and my pages are not finding the css files. This is the link to my css in my app.blade.php file: …
Most efficient way to find bidirectional differences between associative arrays
I have a contact array with a set of values which I need to update. I also have a contactChangeLog array that will save the diff between an existing and updated contact. Only the keys which get updated need to be saved to the log. So with 2 contact arrays: I can use array_diff_assoc()… However, I am ite…