How to download .m4v video from given URL with Laravel? I have a URL for example rtmp://123456.r.cdnsun.net/_definst_/mp4:123456/h264/123456.m4v … Can you recommend me a package for Laravel which could make the process easier? Answer It depends on what exactly you’re trying to achieve. For example…
Tag: laravel
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,…
How to change php dotenv (.env) variables dynamically in laravel or php?
I want something like this: Output : I find one answer How to change variables in the .env file dynamically in Laravel? but here .env is saved permanently, I don’t want to save permanently. How phpunit is doing this ? Because I can put in phpunit.xml this : And env(‘APP_ENV’) gives me ‘…
Ajax File Upload With Form Data Laravel 5.3
i want to upload a profile image of a user to the server and i’m stuck at ajax upload of image all my form data are posting to database including the image name but the file is not uploading to the …
How to correctly set a JWT secret in Laravel with jwt-auth?
I’d like to test the authentication of JWTs in my project as the JWTs will be sent from outside the app, and so they must be signed using the key from my application. Is this possible? Does anyone know of a site that allows you to sign a token using a secret? I tried http://jwtbuilder.jamiekurtz.com/ bu…
Laravel – unsigned with nullable
I am using Laravel 5.3, I want to define a field in table migration as nullable as well as unsigned. As both are index modifier, can I use them in concatenation ? Like: Please also give some reference if there is to these kind of modifications in laravel documentation or somewhere. Please note that I want to …
Detect emoticons in string
I found that you need PHP 7 and MySQL 5.5 to use emoticons in a string that you want to upload to the database. I don’t have these specification on my server so I want to give an error message in laravel or php. Is there a way to detect emoticons in php? If so then I can create a
Laravel casts with relation
I’m making a survey website where users provide answers from 0 to 10. I was experimenting with the casts to store all questions and the answer in 1 row. This is what the scores field looks like in the database This is as expected. The “5” and “6” are ID’s of the question an…
Mocking the response only for a certain parameter
I have a class where I am mocking the get method when called with test1 to return 123. This works fine. However, I want to have all other calls to the get method return what would normally be …
Call to a member function save() on array laravel
Im doing the update method. When I tried to update the specific data, im getting this error “Call to a member function save() on array”. Why? Is there’s something missing in my codes? I also tried to print_r the $result variable, it has a value.. View Controller Route Answer This way can hel…