There are a number of ways to achieve that functionality and I will list them below:
Use the $faker->sentence()
method to generate a title, and substr
to remove the period at the end of the sentence. Solution link
$title = substr($this->faker->sentence(2), 0, -1);
Secondly, use can use rtrim
to remove the .
at the end of the sentence. Solution link
$title = rtrim($this->faker->sentence(2), '.');
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community