Sample code to demonstrate object retriever
This commit is contained in:
1 parent
249659e175
commit
8a5a77c164
3 files changed
+37
-3
No files matched your search
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use CloudObjects\SDK\ObjectRetriever;
|
||||
use ML\IRI\IRI;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
public function index(ObjectRetriever $objectRetriever)
|
||||
{
|
||||
$object = $objectRetriever->getObject(new IRI('coid://cloudobjects.io'));
|
||||
$label = $object->getProperty('http://www.w3.org/2000/01/rdf-schema#label')->getValue();
|
||||
|
||||
return view('home', [
|
||||
'label' => $label
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user