Code Monkey home page Code Monkey logo

api-generator's People

Contributors

boyfromhell avatar dev-lav avatar marpoocknew avatar mumbaikar007 avatar roshchyn avatar sdca avatar thienvu18 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

api-generator's Issues

Exception when trying to access a specific blog post

Hello,

when I try to access the default endpoint that I created for blog posts (/api/v1/posts) it works fine, lists all blog posts. But if I try to do, for example /api/v1/posts/1 I get an exception with the following

count(): Parameter must be an array or an object that implements Countable

public funtion show($id) {
$data = $this->Post->where('id',$id)->first();
if( count($data) > 0){
return $this->helpers->apiArrayResponseBuilder(200, 'success', $data);
}

on

/apigenerator/controllers/api/postController.php line 34

Any help? Thanks

Full image path

An image loaded via Media Finder after outputting to JSON does not have a full path. Therefore, using it through the API is not possible. If any solution?

Two endpoints seems not to work

As-Salamu Alaykum brother, thanks for this plugin, it's awesome !
I just have a question : when i register two endpoints, it doesn't work !
The last created works but the first one doesn't. Is there anything i made wrong ?

Cannot make non static method Illuminate\Routing\Controller::getMiddleware() static in class AhmadFatoni\ApiGenerator\Controllers\ApiGeneratorController

After updating today to the latest October CMS via update in the backend, API Generator no longer works with the error:

Cannot make non static method Illuminate\Routing\Controller::getMiddleware() static in class AhmadFatoni\ApiGenerator\Controllers\ApiGeneratorController

In file: <full_path>/plugins/ahmadfatoni/apigenerator/controllers/ApiGeneratorController.php line 336

Changing the second to last function in the ApiGeneratorController.php ( getMiddleware() ) to a non-static method fixes the issue. Thought you should be aware.

Exception the first time I tried to open the plugin after install

The following exception was thrown the first time I tried to access the plugin inside the admin dashboard. This only happened the first time. It worked fine in subsequent visits.

InvalidArgumentException: Route [fatoni.generate.api] not defined. in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php:305
#0
/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(788):
Illuminate\Routing\UrlGenerator→route('fatoni.generate...', Array, true)
#1
/var/www/html/plugins/ahmadfatoni/apigenerator/controllers/apigeneratorcontroller/create.htm(71): route('fatoni.generate...')
#2
/var/www/html/modules/system/traits/ViewMaker.php(244):
include('/var/www/html/p...')
#3
/var/www/html/modules/system/traits/ViewMaker.php(110):
Backend\Classes\Controller→makeFileContents('/var/www/html/p...')

Mobile app

how to create api for mobile . i want to create login api. so please tell me how can i create login api for mobile android app. i want to pass username and password to login url and after that i want some response from server side. this thing a want to do
so please guide me

Add Condition to Query

Hey - lemme start with that you developed an awesome plugin!

However I'd like to know whether it's somehow possible to add conditions - either by params to your url e.g. yourhost/api?id=X
or directly in the json condition thing like:

{ "fillable": "discord_tag,is_captain > 0" }

Thanks in advance!

Relation isn't showing

I wrote this condition:

{ "fillable": "id", "relation": [{ "name": "team", "fillable": "title" }]}

where my model is created like this:

QueryModel

 public $belongsTo = [
            'team' => [
                'Rikki\Heroeslounge\Models\Team',
                'key' => 'team_id',
                'otherKey' => 'id'
            ],
            'user' => ['RainLab\User\Models\User'],
            'role' => [
        'Rikki\Heroeslounge\Models\SlothRole'
        ]
        ];

Relation Model


  public $hasMany = [
            'sloths' => ['Rikki\Heroeslounge\Models\Sloth', 'order' => 'is_captain desc'],
            'apps' => ['Rikki\Heroeslounge\Models\Apps']
            ];

But the resulting query only shows null.

what am I doing wrong here?

Missing migration in version

When we install your plugin it does not add any table into database, because you never reference your migration file in version

This is your version file:

1.0.1: - 'Initialize plugin.' 1.0.2: - 'Database implementation' 1.0.3: - 'add builder plugin on requirements dependency' 1.0.4: - 'fixing bug on PHP 7'

And it should be like this:

1.0.1: - 'Initialize plugin.' 1.0.2: - 'Database implementation' - builder_table_create_ahmadfatoni_apigenerator_data.php 1.0.3: - 'add builder plugin on requirements dependency' 1.0.4: - 'fixing bug on PHP 7'

Authentication ?

Hello, how would it be possible to have authenticated (JWT) requests ? Thanks

api authentication

how to implement an authentication for requests ?! like passport in Laravel

Add System/files support

Hi,

First, i would like to say you thanks for this plugin cause it's a real pleasure.
Second, i'm trying to create an API for my model but my data have an AttachMany which refers to System/Files (upload).

i've write this relation

{ "fillable": "id,name,image" ,"relation": [{ "name": "gallery", "fillable": "id,disk_name" }]}
but the result is :

{ "status_code": 200, "message": "success", "data": [ { "id": 1, "name": "Hotel Le Mottaret", "image": "/Rooms/cropped-images/XQ7A6799-0-0-0-0-1521716260.jpg", "gallery": [] }, { "id": 2, "name": "Hôtel Ibiza", "image": "/JD1_6391.jpg", "gallery": [] } ] }

How can i get all my files attach to my data and show their link in the result ?

thanks

One to many relationship does no get displayed in Custom Condition

I've multiple photos for a Model
but when if trying to display it, it show empty []
It also not working for normal table relationship with hasMany attribute:

{ "fillable": "id,center_name,center_zone,center_address,contact_number,email,landmark,user_id,state_id,country_id", "relation": [{ "name": "state", "fillable": "id,name,code" }, { "name": "country", "fillable": "id,name,code" }, { "name": "franchises", "fillable": "name,email" }, { "name": "center_photos", "fillable": "id" }] }
This is what ive written
Here franchises is declared as has many and belongs to relation ship with main table

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.