Skip to content

Tag: php

Laravel Jobs Serialization of ‘Closure’ is not allowed

I would like to send Data to a NewsletterStore Job. But it’s failing with the following error. Any suggestions? I also tried to remove the SerializesModels Models trait. Without any success. Error Controller Job Answer Request is not serializable there is a workaround what you are trying to achieve Your…

Split string by last character and save to array?

I have several strings that look like: longname1, anotherlongname2, has1numbers2init3 I would like to use str_split to split off the last character of the strings. Eg: I can get the number alone using substr($string, -1); but need to find an efficient way of retrieving the remainder of the string. I have trie…

Laravel Storage file encoding

I’m trying to save text file as UTF-8 by using Laravel’s Storage facade. Unfortunately couldn’t find a way and it saves as us-ascii. How can I save as UTF-8? Currently I’m using following code to …

SVG icon in twig template

I’m struggling with svg icons. I’m creating menu and to do this I have to use several of svg icons. I already know, that if I want to manipulate colour with help CSS (for example when icon is active/hover) I have to use in HTML <svg> tag not <img src=”path-to-icon.svg”/>. H…

PHP get user id in url 4

I want to get the id from my url like below http://localhost/cpanel-ar/stage_one/reports.php?temp=temp_21day How can GET only the “temp”? Answer I assume that you mean this: This will return an array with your get parameters. for example: http:example.com?getparameter=getvalue returns: