#Laravel passes, invalid apple certificate

1 messages · Page 1 of 1 (latest)

manic verge
#

Hi I'm using https://github.com/chiiya/laravel-passes this is my controller method ```php
public function createApplePass(Request $request) {
$uniqueId = uniqid();

    $pass = new GenericPass([
        'serialNumber' => $uniqueId,
        'description' => '***',
        'organizationName' => '***',
        'passTypeIdentifier' => '****',
        'teamIdentifier' => '****',
    ]);

    $barcode = new Barcode([
        'format' => 'PKBarcodeFormatQR',
        'message' => 'https://my-app/sample-url',
        'messageEncoding' => 'iso-8859-1',
    ]);

    $pass->barcodes = [$barcode];
    $pass->backgroundColor = 'rgb(0, 100, 255)';
    $pass->labelColor = 'rgb(255, 255, 255)';
    
    // dd(file_exists(storage_path("app/public/pass_files/pass.p12")));

    $logoPath = storage_path('app/public/img/layout/logo.png');

    if (file_exists($logoPath) && mime_content_type($logoPath) === 'image/png') {
        $pass->addImage(new Image($logoPath, ImageType::ICON, 1));
        $pass->addImage(new Image($logoPath, ImageType::LOGO, 1));
    } else {
        throw new \Exception('Icon and logo images must exist at ' . $logoPath . ' and be valid PNG files.');
    }

    $signedPass = $this->builder->apple()->create($pass);

    return response()->make($signedPass, 200, [
        'Content-Type' => 'application/vnd.apple.pkpass',
        'Content-Disposition' => 'attachment; filename="pass.pkpass"',
    ]);
}``` I'm getting the error invalid certificate, for the .p12 file. I've checked using file_exists() if it is in the right folder etc. And I followed the github repo it's docs to setup the needed files for an apple pass. So not sure what is wrong.
arctic zodiac