Skip to content

Tag: laravel

Removing html tags in Laravel blade

I have an issue with deleting HTML tags. Well I get string from database And when I filter variable with htmlspecialchars and other, I have < and something else. Is there any function which can just remove tags and set variable to Answer just use {!! $variable !!} to remove the tags from being visible on t…

Laravel Queue How to get data in job handle method

I have created a sequence of messsages to be sent in text messages through twilio. I have created a controller to put the messages in a queue with the data received in the post request. Here is my controller to make queue: And in handle the job , in the handle function } I am not able to figure out

laravel observers are not working

I am trying to listen to model events using laravel observers .The problem is when i submit my form (update or creating new records), nothing happened at all .Do i miss something ? app.php CasesManagerServiceProvider.php CasesObserver.php Cases.php Answer Ok i have found my answer . All the problem was when I…

Testing in laravel against MySQL

Hello i m testing in laravel 5.5 an api using Mysql as database and DatabaseTransactions. Suppose that i have a model Team which may be active or inactive and i want to test getting an inactive Team. This piece of code is problematic if there is no inactive team in my fake seeded database. So what’s the…

Laravel polymorphic with custom foreign key

I have problem with custom shipmentable_type. My structure looks like this: Now I have in my Transfer model realtion like this: The problem is, that to table shipmentable, to column shipmentable_type is going sth like this now: App/Models/Transfer, but I would like to force to be there ‘transfer’ …