<commit_before><?php

namespace LibreEHR\FHIR\Http\Controllers;

use LibreEHR\Core\Contracts\BaseAdapterInterface;
use Illuminate\Http\Request;

class AppointmentController extends AbstractController
{
    protected $appointmentAdapter = null;

    public function __construct( BaseAdapterInterface $appointmentAdapter )
    {
        $this->appointmentAdapter = $appointmentAdapter;
    }

    public function index(Request $request = null)
    {
        return $this->appointmentAdapter->collectionToOutput($request);
    }

    public function post(Request $request)
    {
        return $this->appointmentAdapter->store($request);
    }<commit_msg>Add auth check for controller<commit_after><?php

namespace LibreEHR\FHIR\Http\Controllers;

use LibreEHR\Core\Contracts\BaseAdapterInterface;
use Illuminate\Http\Request;

class AppointmentController extends AbstractController
{
    protected $appointmentAdapter = null;

    public function __construct(BaseAdapterInterface $appointmentAdapter)
    {
        $this->middleware('api.auth');
        $this->appointmentAdapter = $appointmentAdapter;
    }

    public function index(Request $request = null)
    {
        return $this->appointmentAdapter->collectionToOutput($request);
    }

    public function post(Request $request)
    {
        return $this->appointmentAdapter->store($request);
    }
{'fraction_non_alphanumeric': 0.0950626381724392, 'fraction_numerical': 0.0, 'mean_word_length': 4.067164179104478, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6880231', 'n_tokens_mistral': 367, 'n_tokens_neox': 365, 'n_words': 72}