I’d like to have a regex to match a word, even if there are spaces between the characters. When I want to match the word test, it should match the following: test t est t e s t And so on, but it should not match things like this: tste te ts s tet I have this regex: (t[s]*e[s]*s[s]*t[s]*) But
PHP [function.file-get-contents]: Failed to open stream
This is really annoying me, the php script was working and returning the weather from open weather map but literally all of a sudden the php script takes forever to execute and the following error is …
Mocking classes that created with app()->make
I have this code in my __construrct: Now, when i’m unit testing i know that i can mock Guard and pass it’s mock to $auth, but how can i mock dbUserService ? it’s instantiated trough the IoC container. Answer You can use the instance() method of the IoC container to mock any class instanciate…
How to echo SQL table data in auto created html/PHP table
I have a SQL table named res having some rows and columns. For example: Name Class Sub1 Sub2 Sub3 sub4 s1 2 10 12 45 15 s2 2 50 12 14 60 s3 2 10 12 40 15 s4 2 …
Php-ffmpeg “Unknown encoder libfaac” on Windows
I am using laravel 4.2. I am working on a project in that user can upload a video and I need to transcode it that it can be played over all kind of devices. For transcoding I have added php-ffmpeg package from git hub in my project. According to the instructions I have downloaded ffmpeg package from http://ff…
Paypal IPN: certificate verify failed
Since yesterday I’m unable to receive paypal ipn notifications. I’ve check the log file and the error is: [24-Mar-2015 13:48:44] cURL error: [60] SSL certificate problem, verify that the CA cert is …
How to register console command from package in Laravel 5?
Since Laravel 5, it is interest to me – how to register and use console command from package in Laravel 5. As in laracast discuss https://laracasts.com/discuss/channels/tips/developing-your-packages-in-laravel-5, i create a directory structure, add my package to autoload and create a service provider My…
MySQL how to make value expire?
So I’m currently designing a Forgot Password feature for a website. Basically, when the user clicks forgot password it sends them an email with a reset token. I want the reset token to expire in 48 hours(for security reasons). How would I do this in MySQL and PHP. I have a column in my table called rese…
How to use authentication for multiple tables in Laravel 5
Sometimes, we’d like to separate users and admins in different 2 tables. I think it is a good practice. I am looking if that is possible in Laravel 5.
How to disable registration new users in Laravel
I’m using Laravel. I want to disable registration for new users but I need the login to work. How can I disable registration form/routes/controllers?