.  <?php  namespace App\Helpers;  class Helper {  public static function get_first_image($post) { // Laravel Custom Helpers $get_first_img = '';  $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post, $matches);  if(!empty($matches[0][0])) $get_first_img = $matches [0] [0];  if(empty($get_first_img)){ //Defines a default image  $get_first_img = "https://onlinecode.org/images/default.jpg"; 