PHP code example of herinneringenoplinnen / laravel-xml

1. Go to this page and download the library: Download herinneringenoplinnen/laravel-xml library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

herinneringenoplinnen / laravel-xml example snippets

 -i | grep xml



namespace My\App\Namespace;

use FetchLeo\LaravelXml\Contracts\Converter;    
use SimpleXMLElement;
use FetchLeo\LaravelXml\Exceptions\CantConvertValueException;
    
class MyCustomConverter implements Converter 
{
    /**
     * Convert a value to XML.
     *
     * @param Model $value
     * @param SimpleXMLElement $element
     * @return SimpleXMLElement
     * @throws CantConvertValueException
     */
     public function convert($value, SimpleXMLElement $element) : SimpleXMLElement;
     
     /**
      * Determine if this converter can convert the given value.
      *
      * @param mixed $value
      * @param $type
      * @return bool
      */
      public function canConvert($value, $type) : bool;
}
 artisan vendor:publish --provider=FetchLeo\LaravelXml\XmlServiceProvider

php artisan vendor:publish --tag=laravel-xml