Answers for "laravel random"

PHP
8

laravel Str::random

use Illuminate\Support\Str;

$random = Str::random(40);
Posted by: Guest on June-06-2020
3

{{Str::limit laravel

{{Str::limit($category->name, 20)}}

if to end 
  
{{Str::limit($category->name, 20, $end='.......')}}
             
or
  
{{\Illuminate\Support\Str::limit($category->name, 20)}}
Posted by: Guest on December-05-2020
5

laravel get random row

User::all()->random();
User::all()->random(10); // The amount of items you wish to receive
Posted by: Guest on April-22-2020
0

laravel pluck

$users = Users::pluck('name','email');
dd($users);
Posted by: Guest on October-05-2020

Browse Popular Code Answers by Language