ErrorException Undefined variable in Laravel Controller

  laravel, php

I want to generate jobposting schema by using Spatie/schema.org but I get this error; ErrorException Undefined variable:
company app/Http/Controllers/Post/DetailsController.php:289

this is parameters for controller

$JobPosting = Schema::JobPosting()
            ->title($title)
            ->description($description)
            ->identifier(Schema::PropertyValue()
            ->name($company)
            ->value($company_id))
            ->datePosted($created_at)
            ->validThrough($archived_at)
            ->jobstartdate($start_date)
            ->employmentType($postType)
            ->category($category)
            ->hiringOrganization(Schema::Organization()
            ->name($company)
            ->website($website)
            ->url($url)
            ->logo($logo))
            ->jobLocation(Schema::Place()->address($address)
            ->streetAddress($streetAddress)
            ->addressLocality($addressLocality)
            ->addressRegion($city)
            ->addressCountry($Country))
            ->baseSalary(Schema::MonetaryAmount()->Currency($money))
            ->value(Schema::QuantitativeValue()
            ->salarymin($salary_min)
            ->salarymax($salary_max)
            ->unitText($salary_type_id));
    $data['JobPosting'] = $JobPosting;

This is code line for Views

{!! $JobPosting !!}

Source: Ask PHP

LEAVE A COMMENT