Skip to content

Create affliate URL in PHP

I’m trying to create an affiliate url like http://example.com/ref/referrer. I have 2 php files and a .htaccess file. I have a database table called ‘referral’ that stores username of users in a field …

localization FakerFactory does not work in laravel

I have a Post Model with these fields : Now I want to use laravel sedders and model factories to create fake fa_IR localized data and insert to posts table. For that I wrote this in database/factories/ModelFactory.php: Then I created a PostsTableSeeder class like this : And in AppServiceProvider.php added bel…

PHP Fetch image from DM Twitter using REST API?

I have problem when I want to fetch image that was sent to my DM. So when I fetch the DM data from API, I got the media id for the image but how to fetch it? I want to fetch the image and tweet it to …

remove part of string after delimiter in php

I have seen other I have a string ” cccc cccc – fff” I need to return “cccc cccc” I don’t need to delimiter too I tried to echo the result of substr($mystring , 0, strpos($mystring , “-“)); but it return nothing I also tried resulted returned the main string and…

php post value from FOREACH to another page

I’ve never asked any question here before, but after spending many hours searching for a hint I decided to ask a question. I have a project at school where I need to create a table from DB for all …

Laravel active menu item for url included parameters

I’m trying to set active class in my list item, but it doesn’t work. My code in blade: So, if I write: li class=”@if(getRouteName() == ‘site@index’){{ ‘active’ }}@endif” , it works nice, but in my case the problem is that I want to get ‘active’ class…