src/Laito/Controller.php
public function show($id = null)
    {
        // Check the ID
        if (!isset($id)) {
            throw new \InvalidArgumentException('Undefined ID', 400);
        }

        // Get record
        $item = $this->model->find($id);

        // Abort if the record is not found
        if (!$item) {
            throw new \Exception('Element not found', 404);
        }

        // Return response
        return [
            'success' => true,
            'data' => $item
        ];
    }
public function show($id = null)
    {
        // Check the ID
        if (!isset($id)) {
            throw new \InvalidArgumentException('Undefined ID', 400);
        }

        // Get record
        $item = $this->model->find($id);

        // Abort if the record is not found
        if (!$item) {
            throw new \Exception('Element not found', 404);
        }

        // Return response
        return [
            'success' => true,
            'data' => $item
        ];
    }
public function show ( $ id = null ) { // Check the ID if ( ! isset ( $ id ) ) { throw new \ InvalidArgumentException ( 'Undefined ID' , 400 ) ; } // Get record $ item = $ this -> model -> find ( $ id ) ; // Abort if the record is not found if ( ! $ item ) { throw new \ Exception ( 'Element not found' , 404 ) ; } // Return response return [ 'success' => true , 'data' => $ item ] ; }
Display the specified resource

@param array $id Resource ID
@return array Response
Display the specified resource