Restiful api using laravel 5.4 - laravel-5.4

I wanna make a rest api in laravel i tried several ways but all of them failed , can anyone help me out with a simple way or just tell me how to post 1 field and retrieve it using api to know how it works! thanks

Related

Trouble with connecting with an Api Rest

I am trying to connect with an Api Rest, this is the link: https://movie-database-alternative.p.rapidapi.com/?s=Avengers+Endgame&r=json&page=1 , the problem is that i have never work with JSON and i don't know what to do. This link makes a get to the movies named "Avengers endgame", but I need it to be a specific link to be able to make the connection to the rest api. (This api is public, I'm working with data virtualization).
I tried to make some connections but i dont quite understand the syntaxis of JSON. It is not my field :( Coud somebody help me? Thanks!

Can I use an ASP form to POST JSON Data to an API?

Im having a form in ASP with 3 simple fields . Im trying to POST that form with JSON but I dont know anything about JSON code. Im trying to find some scripts but I don`t really know where to start looking and how to combine them with ASP!
Can you please help me with that?

How can I convert postgres database to JSON file?

I'm working on flutter mobile application which should be attached (connected) with the web platform that I developed with laravel, I want to generate JSON file from Postgres dynamically , I mean when I update any thing in the database it will be updated in the mobile also and I need to display the data in the mobile application.
I followed this tutorial and I understood that I must convert the database or the tables into json file. How I'm going to do it please, it's the first time I'm working with Flutter and json.
https://www.youtube.com/watch?v=m7b7_Nq7XSs&list=PLK7ZDJTUghFAmRR4mueiai7zq1RJfMQ62&index=11&t=1s
If you're just getting started, please take your time and get yourself familiar with the basics and how flutter treats the data coming from a database.
Also something you should have been reading and understood is JSON and serialization.
Based on that it is not advisable that you retrieve JSON right from the database. Instead, JSON serialization happens in one way or another inside flutter using one of the recommended approaches.
Specifically for working with PostgreSQL, there seems to be a decent tutorial.
Please keep in mind that what you actually have asked for here ("... database to JSON file") indicates you really want a file output, which is completely contrary to the API that you're going to provide with flutter.
Of course it is possible to query PostgreSQL and get the result already in JSON format, but that then also means you won't be able to work with the data model inside flutter.
However, if you finally know what you are doing, here is a way to get the result of any PostgreSQL query directly as JSON:
SELECT json_agg(t) FROM (
SELECT ...whatever you can think of...
) AS t;
If you are using laravel version greater than 5, you can use API resources to create API and connection to PostgreSQL(https://laravel.com/docs/5.7/database). It is so simple to create API using laravel API resources. Then in Flutter only thing you have to do is request endpoints you have created using laravel.

Incomplete Json - Behance API

I'm working with the Behance API to build a plugin. I got the API key and built the URL to get my project list data in JSON format.
The weird thing is that, the JSON is not complete at all, there are many project missing, 14 missing to be specific.
Does someone have any idea?
Thanks in advance.
Found the solution here: https://help.behance.net/hc/en-us/community/posts/202357274-Number-of-Behance-API-request-results-limited-to-25-
It seems that by default the number of items is limited to 25. To get more you need to paginate adding a query get after the URL.
ex: http://www.behance.net/v2/users/gokhanaltinigne/projects?api_key=##&per_page=25&page=2

How to create Restful api for mobile app in laravel 5.2

I'm creating an api for a mobile app in laravel version 5.2, but I don't have any idea how to return exception in JSON format. I've been doing api development and tested using chrome postman.
Please help me how can I start with laravel 5.2?
I can't understand how to set error response in laravel 5.2.
I've already tried below plugin, but still didn't succeed:
json-api with laravel,
dingo/api, it's work with laravel 4
How can we do authentication in laravel 5.2 from mobile app?
Something good references and video link so I can learn and development in laravel 5.2 very friendly.
For the creation of Restful API using Laravel 5.2 you could use below mention Laravel API generator Package .
https://github.com/InfyOmLabs/laravel-generator
As well as for the Authentication based on Token you could refer below mention Link.
https://gistlog.co/JacobBennett/090369fbab0b31130b51
One more additional thing if you have already created database / system and wants to use that for the creation of API using Laravel Generator package than use below mention command.
php artisan infyom:api_scaffold Packages --fromTable
--tableName=packages
Hope this information will help you to create complete Restful API using Laravel 5.2
I am also creating a Web Based Application for Android using Laravel 5.2 and we are using Rest API for this process. We are using API Guard for the purpose of Authentication. It works Perfect for us. We are authenticating it for Android as well as AngularJS and works fine for us. https://github.com/chrisbjr/api-guard. A Clear Documentation is Provided here. Hope so you have got your doubt cleared using this.