Coder Social home page Coder Social logo

laravel-job-posting's Introduction

build Total Downloads Latest Stable Version License

laravel-job-posting

Easily add job posting structured data to your job posts.

Introduction

Google is bringing their job search experience to more and more countries, and with that comes the need to have properly structured job posting data.

This package supplies the JobPosting facade, allowing you to easily add properly structured json-ld job postings to any blade template using {!! JobPosting::render($job) !!}.

Installation

You may use Composer to install laravel-job-posting into your Laravel project:

composer require impact-blue/laravel-job-posting

After installing laravel-job-posting, publish its config usinfg the vendor:publish Artisan command:

php artisan vendor:publish

Configuration

After publishing laravel-job-posting's config its primary configuration file will be located at config/job-posting.php. This configuration file allows you to configure what data to use for the required properties described here: https://developers.google.com/search/docs/data-types/job-posting

You may use any model attributes available in the model passed to {!! JobPosting::render($job) !!}. If the defined string is not a model attribute the defined string will be used as is. If you plan on defining a required property using the second parameter of the render function (see below) you may set the property to false in the configuration file and it will be skipped during the property check.

Optional properties

The configuration file only defines Google's required properties, but you are free to add any optional (or required) properties using a collection or array as the second parameter to the render function. The data in the second parameter will be merged with whatever data was defined in the configuration file.

For example:

#!php
<?php
$job = Job::first();
$optionalProperties = [
    'baseSalary' => [
        '@type' => 'MonetaryAmount',
        'currency' => 'JPY',
        'value' => [
        '@type' => 'QuantitativeValue',
        'unitText' => 'HOUR',
		'value' => $job->salary,
    ],
];

And in your blade file:

#!blade
{!! JobPosting::render($job, $optionalProperties) !!}

License

laravel-job-posting is open-sourced software licensed under the MIT license.

laravel-job-posting's People

Contributors

martinnabhan avatar

Watchers

Fuminori Hirakawa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.