Skip to content

Tag: php

How to create a link to another PHP page

I just converted some of my HTML pages to PHP pages, and I’m not that familiar with PHP. In my HTML pages, assuming it’s just a static web app, I can link to another page quite simply by playing the following anchor on the page: <a href=”go-to-this-page.html”>This is a link</a…

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…

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…

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…