public function apiPrepared()
    {
        $files = File::orderBy('created_at', 'desc')->where('is_published', 1)->get();
        $allFiles = [];

        foreach ($files as $file) {
            array_push($allFiles, [
                'file_identifier' => CryptoService::url_encode($file->name).'/'.CryptoService::url_encode($file->location),
                'file_name' => $file->name,
                'file_date' => $file->created_at->format('F jS, Y'),
            ]);
        }

        return $allFiles;
    }
public function apiPrepared()
    {
        $files = File::orderBy('created_at', 'desc')->where('is_published', 1)->get();
        $allFiles = [];

        foreach ($files as $file) {
            array_push($allFiles, [
                'file_identifier' => CryptoService::url_encode($file->name).'/'.CryptoService::url_encode($file->location),
                'file_name' => $file->name,
                'file_date' => $file->created_at->format('F jS, Y'),
            ]);
        }

        return $allFiles;
    }
public function apiPrepared ( ) { $ files = File :: orderBy ( 'created_at' , 'desc' ) -> where ( 'is_published' , 1 ) -> get ( ) ; $ allFiles = [ ] ; foreach ( $ files as $ file ) { array_push ( $ allFiles , [ 'file_identifier' => CryptoService :: url_encode ( $ file -> name ) . '/' . CryptoService :: url_encode ( $ file -> location ) , 'file_name' => $ file -> name , 'file_date' => $ file -> created_at -> format ( 'F jS, Y' ) , ] ) ; } return $ allFiles ; }
Files output for API calls

@return array
Files output for API calls