{"id":33527204,"url":"https://github.com/markcell/salvaon","last_synced_at":"2025-11-26T13:06:04.503Z","repository":{"id":21153473,"uuid":"24455908","full_name":"markcell/salvaon","owner":"markcell","description":"Package for Laravel based on Eloquent to manage XML files.","archived":false,"fork":false,"pushed_at":"2021-05-18T19:23:00.000Z","size":26,"stargazers_count":5,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-21T11:56:36.432Z","etag":null,"topics":["laravel","php","xml"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markcell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-25T11:46:13.000Z","updated_at":"2024-04-10T13:53:50.000Z","dependencies_parsed_at":"2022-07-19T23:17:49.256Z","dependency_job_id":null,"html_url":"https://github.com/markcell/salvaon","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/markcell/salvaon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markcell%2Fsalvaon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markcell%2Fsalvaon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markcell%2Fsalvaon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markcell%2Fsalvaon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markcell","download_url":"https://codeload.github.com/markcell/salvaon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markcell%2Fsalvaon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286079811,"owners_count":27282121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-26T02:00:06.075Z","response_time":193,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","php","xml"],"created_at":"2025-11-26T13:06:01.254Z","updated_at":"2025-11-26T13:06:04.495Z","avatar_url":"https://github.com/markcell.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Salvaon\n[![Latest Stable Version](https://poser.pugx.org/markcell/salvaon/v/stable.svg)](https://packagist.org/packages/markcell/salvaon) [![Total Downloads](https://poser.pugx.org/markcell/salvaon/downloads.svg)](https://packagist.org/packages/markcell/salvaon) [![Latest Unstable Version](https://poser.pugx.org/markcell/salvaon/v/unstable.svg)](https://packagist.org/packages/markcell/salvaon) [![License](https://poser.pugx.org/markcell/salvaon/license.svg)](https://packagist.org/packages/markcell/salvaon)\n\nPackage for Laravel based on Eloquent to manage XML files with SimpleXMLElement and xpath.\n\n\u003e [!WARNING]\n\u003e This repository hasn't been actively maintained for quite some time. The code is still here if you find it useful, but no further updates or support will be provided.\n\n## Usage\nInstall the package through Composer.\n\n```js\n{\n    \"require\": {\n        \"laravel/framework\": \"4.2.*\",\n        \"markcell/salvaon\": \"dev-master\" // or \"markcell/salvaon\": \"1.0.*\"\n    }\n}\n```\n\n\nEdit 'app/config/app.php', and add a new item to the 'aliases' array:\n\n```php\n'Salvaon' =\u003e 'Markcell\\Salvaon\\Salvaon'\n```\n\n\nPublish configuration file from package:\n\n```bash\nphp artisan config:publish markcell/salvaon\n```\n\nYou may now edit these options at 'app/config/packages/markcell/salvaon/config.php'. Or copy this file to 'app/config' folder with name 'salvaon.php'.\n\n\nNow, your XML models can simply extend 'Salvaon':\n\n```php\n\u003c?php\n\nclass Breakfast extends Salvaon {\n\n    /**\n     * The file associated with the model\n     *\n     * @var string\n     */\n    protected $file = 'breakfast.xml';\n   \n    /**\n     * Root element of the document\n     *  \n     * @var string\n     */\n    protected $root = 'breakfast';  \n \n    /**\n     * Child elements of the root\n     * \n     * @var string \n     */\n    protected $child = 'food';     \n \n    /**\n     * The primary key for the model\n     *\n     * @var string\n     */\n    protected $primaryKey = 'name';\n\n}\n```\n\n\nSee example of 'breakfast.xml' file on this link: \nhttps://github.com/markcell/salvaon/blob/master/breakfast.xml\n\n\n## Examples\n```php\n// Get all child nodes from XML root.\n$foods = Breakfast::all();\n\n\n// Count elements from selected childs $foods.\n$foods-\u003ecount();\n\n\n// Get child from XML by $primaryKey or fail if not exists.\nBreakfast::findOrFail('French Toast');\n\n\n// Get child from XML with where condition.\n$food = Breakfast::select()-\u003ewhere('name', '=', 'French Toast')-\u003eget();\n\n// Update fields from selected child $food. \n$food-\u003eprice = '3.25€';\n$food-\u003ecalories = 450;\n\n// Save changes.\n$food-\u003esave();\n\n\n// Create new XML child.\n$new = new Breakfast;\n\n// Add data to child fields.\n$new-\u003ename = 'French Toast';\n$new-\u003eprice = '4.50€';\n$new-\u003edescription = 'Thick slices made from our homemade sourdough bread';\n$new-\u003ecalories = 600;\n\n// Save new child to XML file with tag attributes.\n$new-\u003esave(array('id' =\u003e 26092014));\n```\n\n## License\nLicensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkcell%2Fsalvaon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkcell%2Fsalvaon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkcell%2Fsalvaon/lists"}