app/Api/V1/Controllers/ParastatalController.php
/**
     * Display a listing of the parastatals.
     *
     * @param Parastatal $parastatal
     * @return Parastatal[]|\Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection
     */
Display a listing of the parastatals.
Display a listing of the parastatals .
public function index(Parastatal $parastatal)
    {
        $parastatals = Parastatal::with('creator')
            ->with('updater')
            ->with('address')
            ->get();
        if ($parastatal->showCode()) {
            $parastatals->makeVisible(['code', 'phone', 'email', 'address_id', 'created_by', 'updated_by']);
        }
        return $parastatals;
    }
public function index ( Parastatal $ parastatal ) { $ parastatals = Parastatal :: with ( 'creator' ) -> with ( 'updater' ) -> with ( 'address' ) -> get ( ) ; if ( $ parastatal -> showCode ( ) ) { $ parastatals -> makeVisible ( [ 'code' , 'phone' , 'email' , 'address_id' , 'created_by' , 'updated_by' ] ) ; } return $ parastatals ; }
Display a listing of the parastatals.
Display a listing of the parastatals .