GithubHelp home page GithubHelp logo

apiato / apiato Goto Github PK

View Code? Open in Web Editor NEW
3.0K 131.0 480.0 9.7 MB

PHP Framework for building scalable API's on top of Laravel.

Home Page: http://apiato.io

License: MIT License

PHP 98.43% Blade 1.53% JavaScript 0.04%
api php-api api-centric porto apiato starter-kit starter-project starter-app api-starter php-framework

apiato's Introduction

tests status code coverage latest stable version
total downloads license chat

Apiato Logo

Build scalable API's faster | With PHP 8.0 and Laravel 10.0

About Apiato

Apiato is a framework for building scalable and testable API-Centric Applications with PHP, build on top of Laravel.

It is designed to help you build scalable API's faster, by providing tools and functionalities that facilitate the development of any API-Centric App.

Apiato is built using Porto, a new architectural pattern and comes with an amazing list of features:

Learning Apiato

Apiato has an extensive and thorough documentation.

Support and Community

For free community support, join our Discord server.

Contributing

Thank you for considering contributing to the Apiato framework! The contribution guide can be found in the Apiato documentation.

Code of Conduct

In order to ensure that the Apiato community is welcoming to all, please review and abide by the Code of Conduct.

Security Vulnerabilities

If you discover a security vulnerability within Apiato, please send an e-mail to Mohammad Alavi via [email protected]. All security vulnerabilities will be promptly addressed.

Project Maintainers


Mahmoud Zalt
@mahmoudz

Mohammad Alavi
@Mohammad-Alavi

Moslem Deris
@mderis

apiato's People

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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apiato's Issues

Automate Policies mapping

Search for Policies in the directory and search for Models with the same Names if they exist then map them in a Core Policy Provider.

MiddlewaresLoaderTrait syntax error fixed

Hi @Mahmoudz,

I got new bugs in "app/Port/Middleware/Loaders/MiddlewaresLoaderTrait.php", on running composer install.

PHP Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in ../app/Port/Middleware/Loaders/MiddlewaresLoaderTrait.php on line 24

From this:

(App::make(PortKernel::class))
           ->registerMiddlewares($this->middleware)
           ->registerMiddlewareGroups($this->middlewareGroups);

To this:

(App::make(PortKernel::class)
           ->registerMiddlewares($this->middleware)
           ->registerMiddlewareGroups($this->middlewareGroups));

All solved !

DATABASE_QUERIES_DEBUG true error

When I ran php artisan migrate I received that exception. If I change DATABASE_QUERIES_DEBUG to false the error does not appear

[ErrorException]
Missing argument 2 for App\Port\Provider\Providers\PortServiceProvider::App\Port\Provider\Traits{closure}()

What migrations are used?

A lot of (all?) containers have their migrations duplicated to /database/migrations, what are they for? Which migrations are run by php artisan migrate?

Where should I put new migrations for new containers?

ModelsFactory doesn't support multiple models in container

see ModelsFactory.php. It assumes only one model factory per Container.

if (is_dir($containersDirectory)) {
        $containerFactoryFile = $containersDirectory . $containerName . 'Factory.php';

        if (is_file($containerFactoryFile)) {
            include($containerFactoryFile);
        }
    }

How do I register multiple model factories per container?

MongoDB supports ?

Hello Mahmoudz,
I'm planning to use Hello API and jenssegers/laravel-mongodb for my next project, but in document Hello API required

All Models MUST extend from App\Port\Model\Abstracts\Model

Do you have any suggest ?
One more thing, when i'm testing latest version i got this error:

{ message: "Class 'App\Port\Controller\Abstracts\KernelWebController' not found", code: 1, status_code: 500 }

How to make containers compatible with "standard" Laravel App?

Hi, as the title says, would be great that containers could be compatible with "standard" Laravel apps, any ideas on how to achieve this?

  • Maybe make the PORTO layer like a Laravel vendor package? The PORTO package would be a containers dependency (obviously)...
  • But what about the "bootstrap/app.php" file?
  • What about the Hello-API default containers?

Would be awesome make use of containers everywhere on Laravel, the authentication and user scaffolding are better than the default Laravel offers... or maybe is this a bad idea?

Thanks!!!

Question: what if we want to write parallel some app that consume the API that we are writing?

Hi!!

If I want to create in parallel an application that consume the API for the container(s) created, where to put this code? Maybe:

  • app
    • Containers
      • Users
        • Actions
        • Tasks
        • ...
        • Consumers (or CLI's or whatever) // here is the container for the platform app API consumer
          • Android
          • AngularJS
          • Angular 2
            • src // module bundle source
          • JavaDesktop
          • VB.Net

Off course, with Angular 2 we have web, mobile and desktop apps with slight changes on the same code base (and some limitations too), I am writing the code on Angular 2. It's for demonstration purposes only...

This is with the purpose of make available the API app and the API consumer on the same project and having the latest fixes/features available on both sides. Even when this maybe means have a like Hello-API consumer core.

Or is a better idea to make these pieces separated?

Thanks!!

Question - web login

Hi,

if i submit the login web form and the App\Containers\Authentication\UI\WEB\Requests\LoginRequest fails I get the following response:

{"message":"Invalid Input.","errors":{"email":["The email field is required."],"password":["The password field is required."]},"status_code":422}

Shouldn't I get a redirect response to send the user back to their previous location and errors flashed to session?

Can you please explain this feature?

Thanks

On generating api doc it gives error

When i run following command it gives error

apidoc -f .php -i src -o public/documentation

error: Referenced groupname does not exist / it is not defined with @apiDefine. { File: 'src\\Modules\\User\\Routes\\Api\\v1.php', Block: 1, Element: '@apiUse', Groupname: 'Headers_Normal', Definition: '@apiUse group', Example: '@apiDefine MyValidGroup Some title\n@apiUse MyValidGroup' }

error: Referenced groupname does not exist / it is not defined with @apiDefine. { File: 'src\\Modules\\User\\Routes\\Api\\v1.php', Block: 1, Element: '@apiUse', Groupname: 'Headers_Normal', Definition: '@apiUse group', Example: '@apiDefine MyValidGroup Some title\n@apiUse MyValidGroup' }

Error testing web routes without using WithoutMiddleware trait

Testing web routes without the mentioned trait causes this error:

1) App\Containers\Authentication\UI\WEB\Tests\Functional\UserLoginTest::testUserLogin
InvalidArgumentException: Expecting a DOMNodeList or DOMNode instance, an array, a string, or null, but got "Illuminate\View\View".

/home/user/Code/hello/vendor/symfony/dom-crawler/Crawler.php:123
/home/user/Code/hello/vendor/symfony/dom-crawler/Crawler.php:70
/home/user/Code/hello/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithPages.php:96
/home/user/Code/hello/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithPages.php:61
/home/user/Code/hello/app/Containers/Authentication/UI/WEB/Tests/Functional/UserLoginTest.php:22

If the test in question uses the trait, everything goes green, but these behavior isn't convenient. Disabling middlewares sometimes on some tests is useful, but it isn't if they are always disabled.

artisan command passport isn't defined

I have made installation manuali via git.

When I tried to run the command "php artisan passport:client --personal" from DataBase Setup section I received error "[Symfony\Component\Console\Exception\CommandNotFoundException] There are no commands defined in the "passport" namespace".

As I understend I have to install package Passport previuosly - but this isn't written in documentation for installation.

Regards
Yakov

Add Skip-Update option on the containers:add console command

Add the ability to skip composer update if needed when adding Containers. (code is almost there and commented out on both commands but needs testing).

  • CloneContainersCommand
  • DeleteContainersCommand

Also do: use the skip option in the root composer.json file when installing the default Containers. And then add the composer update on it's own line after that command just to see the display of that command while creating a project.

Class 'Hello\Providers\AppServiceProvider' not found.

I cloned the repository on my local machine and ran composer install. This is the exception that I got.

[Symfony\Component\Debug\Exception\FatalErrorException]
  Class 'Hello\Providers\AppServiceProvider' not found


Script php artisan optimize handling the post-install-cmd event returned with an error


  [RuntimeException]
  Error Output:


Am I missing something or is the repository still in development?

PortServiceProviderTrait wrong directory in publisher

Line 150 of app/Port/Provider/Traits/PortServiceProviderTrait.php has

private function publishModuleMigrationsFiles($containerName)
{
$containerMigrationsDirectory = base_path() . '/app/Containers/' . $containerName . '/Database/Migrations/';
if (is_dir($containerMigrationsDirectory)) {
$this->publishes([
$containerMigrationsDirectory => database_path('migrations'),
], 'migrations');
}
}

Shouldn't it be "/Data"?

Error optimize post-install-cmd

Hi @Mahmoudz,

I got this error:
App\Port\Provider\Abstracts\ServiceProviderAbstract and App\Port\Provider\Loaders\ProvidersLoaderTrait define the same property ($portProvidersDirectories) in the composition of App\Port\Provider\Providers\MainServiceProvider. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed

when running composer install

my environment:

  1. php-fpm 5.6
  2. nginx
  3. mysql 5.5

About the containers generator and base layout

Hi, I have reading the Generator container for Hello-API, looks great!! I understand that it’s a on progress work yet, but I want to contribute with a package that I use on my projects to make quick CRUD apps (CrudGenerator) with a web GUI.
I have been writing some code to generate Porto containers and I want to share you the CRUDGenerator package, this package has some dependencies that I have to write to make compatible with Hello-API, the most important is the template layout system, which would be useful for all the containers that serve html, it would be the base html layout… so, would you let me contribute with this?
I have never shared my work with other developers, I'm a novel programmer but I will try my best for follow the Porto conventions and improve my self to make a good job…

I will be attentive to your comments…

PD: I have a basic Angular 2 app (not a private repo) that consumes the Hello-API, I want to share this project here too, but I don’t know if it is under the Porto-SAP scope.

Issue on Laravel-5.3 branch

I tried Install the 5.3 branch...
I manage to set up the environment correctly...
and successfully visited api.hello.dev and see this response

["Welcome to Hello API."]

I receive the Following Error
php artisan route:list

[ReflectionException]
  Class App\Http\Controllers\EnvController does not exist

php artisan api:routes

 [RuntimeException]
  Session store not set on request.

php artisan jwt:generate

Does not generate a new key in .env file

php artisan api:cache

[LogicException]
  Unable to prepare route [auth/google/test] for serialization. Uses Closure.

Also many of the phpunit test are failing

Time: 14.81 seconds, Memory: 44.00MB

There were 34 failures:

1) App\Containers\Authentication\UI\API\Tests\Functional\LoginTest::testLoginExistingUser_
Failed asserting that '200' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/Authentication/UI/API/Tests/Functional/LoginTest.php:37

2) App\Containers\Authentication\UI\API\Tests\Functional\LoginTest::testLoginExistingUserUsingGetRequest
Failed asserting that '405' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/Authentication/UI/API/Tests/Functional/LoginTest.php:60

3) App\Containers\Authentication\UI\API\Tests\Functional\LoginTest::testLoginNonExistingUser
Failed asserting that '401' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/Authentication/UI/API/Tests/Functional/LoginTest.php:79

4) App\Containers\Authentication\UI\API\Tests\Functional\LoginTest::testLoginExistingUserWithoutEmail_
Failed asserting that '422' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/Authentication/UI/API/Tests/Functional/LoginTest.php:106

5) App\Containers\Authentication\UI\API\Tests\Functional\LoginTest::testLoginExistingUserWithoutPassword
Failed asserting that '422' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/Authentication/UI/API/Tests/Functional/LoginTest.php:133

6) App\Containers\Authentication\UI\API\Tests\Functional\LoginTest::testLoginExistingUserWithoutEmailAndPassword
Failed asserting that '422' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/Authentication/UI/API/Tests/Functional/LoginTest.php:158

7) App\Containers\Authentication\UI\API\Tests\Functional\LogoutTest::testLogout_
Failed asserting that '202' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/Authentication/UI/API/Tests/Functional/LogoutTest.php:23

8) App\Containers\Authentication\UI\API\Tests\Functional\LogoutTest::testLogoutWithGetRequest
Failed asserting that '405' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/Authentication/UI/API/Tests/Functional/LogoutTest.php:37

9) App\Containers\Authentication\UI\API\Tests\Functional\LogoutTest::testLogoutWithoutToken
Failed asserting that '401' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/Authentication/UI/API/Tests/Functional/LogoutTest.php:51

10) App\Containers\Contact\UI\API\Tests\Functional\ContactUsTest::testContactUs
Failed asserting that '202' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/Contact/UI/API/Tests/Functional/ContactUsTest.php:47

11) App\Containers\Countries\UI\API\Tests\Functional\ListAllCountriesTest::testListAllCountries_
Failed asserting that '200' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/Countries/UI/API/Tests/Functional/ListAllCountriesTest.php:26

12) App\Containers\Email\UI\API\Tests\Functional\SetUserEmailTest::testSetUserEmail_
Failed asserting that '202' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/Email/UI/API/Tests/Functional/SetUserEmailTest.php:42

13) App\Containers\Email\UI\API\Tests\Functional\SetVisitorEmailTest::testSetVisitorEmail_
Failed asserting that '202' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/Email/UI/API/Tests/Functional/SetVisitorEmailTest.php:32

14) App\Containers\Paypal\UI\API\Tests\Functional\CreatePaypalAccountTest::testCreatePaypalAccount
Failed asserting that '202' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/Paypal/UI/API/Tests/Functional/CreatePaypalAccountTest.php:35

15) App\Containers\Stripe\UI\API\Tests\Functional\CreateStripeAccountTest::testCreateStripeAccount
Failed asserting that '202' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/Stripe/UI/API/Tests/Functional/CreateStripeAccountTest.php:39

16) App\Containers\Tracker\UI\API\Tests\Functional\TrackCloseTest::testTrackClose
Failed asserting that '202' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/Tracker/UI/API/Tests/Functional/TrackCloseTest.php:40

17) App\Containers\Tracker\UI\API\Tests\Functional\TrackOpenTest::testTrackOpen
Failed asserting that '202' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/Tracker/UI/API/Tests/Functional/TrackOpenTest.php:33

18) App\Containers\User\UI\API\Tests\Functional\DeleteUserTest::testDeleteExistingUser_
Failed asserting that '202' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/User/UI/API/Tests/Functional/DeleteUserTest.php:25

19) App\Containers\User\UI\API\Tests\Functional\ListAllUsersTest::testListAllUsersByAdmin_
Failed asserting that '200' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/User/UI/API/Tests/Functional/ListAllUsersTest.php:38

20) App\Containers\User\UI\API\Tests\Functional\ListAllUsersTest::testListAllUsersByNonAdmin_
Failed asserting that '403' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/User/UI/API/Tests/Functional/ListAllUsersTest.php:56

21) App\Containers\User\UI\API\Tests\Functional\RefreshUserTest::testRefreshUserById_
Failed asserting that '200' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/User/UI/API/Tests/Functional/RefreshUserTest.php:30

22) App\Containers\User\UI\API\Tests\Functional\RefreshUserTest::testRefreshUserByToken_
Failed asserting that '200' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/User/UI/API/Tests/Functional/RefreshUserTest.php:58

23) App\Containers\User\UI\API\Tests\Functional\RegisterUserThatWasNotVisitorTest::testRegisterNewUserWithCredentials_
Failed asserting that '200' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/User/UI/API/Tests/Functional/RegisterUserThatWasNotVisitorTest.php:29

24) App\Containers\User\UI\API\Tests\Functional\RegisterUserThatWasNotVisitorTest::testRegisterNewUserUsingGetVerb
Failed asserting that '405' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/User/UI/API/Tests/Functional/RegisterUserThatWasNotVisitorTest.php:55

25) App\Containers\User\UI\API\Tests\Functional\RegisterUserThatWasNotVisitorTest::testRegisterExistingUser
Failed asserting that '422' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/User/UI/API/Tests/Functional/RegisterUserThatWasNotVisitorTest.php:84

26) App\Containers\User\UI\API\Tests\Functional\RegisterUserThatWasNotVisitorTest::testRegisterNewUserWithoutEmail
Failed asserting that '422' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/User/UI/API/Tests/Functional/RegisterUserThatWasNotVisitorTest.php:98

27) App\Containers\User\UI\API\Tests\Functional\RegisterUserThatWasNotVisitorTest::testRegisterNewUserWithoutName
Failed asserting that '422' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/User/UI/API/Tests/Functional/RegisterUserThatWasNotVisitorTest.php:117

28) App\Containers\User\UI\API\Tests\Functional\RegisterUserThatWasNotVisitorTest::testRegisterNewUserWithoutPassword
Failed asserting that '422' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/User/UI/API/Tests/Functional/RegisterUserThatWasNotVisitorTest.php:135

29) App\Containers\User\UI\API\Tests\Functional\RegisterUserThatWasNotVisitorTest::testRegisterNewUserWithInvalidEmail
Failed asserting that '422' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/User/UI/API/Tests/Functional/RegisterUserThatWasNotVisitorTest.php:155

30) App\Containers\User\UI\API\Tests\Functional\RegisterUserThatWasVisitorTest::testRegisterExistingVisitorAsNewUserWithCredentials_
Failed asserting that '200' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/User/UI/API/Tests/Functional/RegisterUserThatWasVisitorTest.php:33

31) App\Containers\User\UI\API\Tests\Functional\RegisterVisitorTest::testRegisterNewVisitor_
Failed asserting that '200' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/User/UI/API/Tests/Functional/RegisterVisitorTest.php:27

32) App\Containers\User\UI\API\Tests\Functional\RegisterVisitorTest::testRegisterExistingVisitor_
Failed asserting that '200' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/User/UI/API/Tests/Functional/RegisterVisitorTest.php:50

33) App\Containers\User\UI\API\Tests\Functional\UpdateUserTest::testUpdateExistingUser_
Failed asserting that '200' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/User/UI/API/Tests/Functional/UpdateUserTest.php:30

34) App\Containers\User\UI\API\Tests\Functional\UpdateUserTest::testUpdateExistingUserWithEmptyValues
Failed asserting that '417' matches expected 400.

/home/vagrant/Sites/Hello-API/app/Containers/User/UI/API/Tests/Functional/UpdateUserTest.php:52

FAILURES!
Tests: 41, Assertions: 43, Failures: 34.

Tests fails if config('app.locale') is different than 'en'

I have playing with the containers language files, and have that if I change the locale app config to spanish (or whatever different from english) many tests fails... Why? The error seems related to the spatie package tables... I have wasted three hours finding the error, but really? the local config? WTH!!... this is so weird, I have missed something?

I solve this bug adding a env variable to the phpunit.xml file setting locale to en.

Simplest way to completely disable a container

There's several parts of Hello API which I will probably never use, but I'd like to keep them just for reference, since the included containers make for very good examples.

What is the simplest way to "disable" one of the included containers, for example Paypal? So that no Paypal routes are registered, no Paypal API documentation, etc.

Containers Generator

Example usage php artisan container:create... This should generate all the basic files with sample names:

  • All the basic directories
  • Post Model
  • UI for WEB and API including routes, controllers, requests,...
  • Tests
  • Data: PostRepository, Migrations, Factories
  • Main ServiceProvider
  • ............... everything else

Documentation error? Receiving Illuminate\Http\Exception\HttpResponseException

https://hello-api.readme.io/docs/requests

"All Requests MUST extend from App\Porto\Request\Abstracts\Request"

<?php
namespace App\Containers\Exam\UI\API\Requests;

use App\Port\Request\Abstracts\Request; // <- !

class GetExamByIdRequest extends Request
{
    public function rules()
    {
        return [];
    }
}

The above request class gives me a strange HttpResponseException for no obvious reason. When I subclass Dingo\Api\Http\Request instead, everything works as expected. Is the documentation outdated?

Thanks for the great work btw

Cors and Json request error

When I try to request with an x-www-form-urlencoded content type, everything works fine

Request

Accept:application/json, text/plain, */*
Accept-Encoding:gzip, deflate
Accept-Language:fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4
Cache-Control:no-cache
Connection:keep-alive
Content-Length:49
Content-Type:application/x-www-form-urlencoded
Host:api.hello.local
Origin:http://hello.local
Pragma:no-cache
Referer:http://hello.local
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.92 Safari/537.36

Response

Access-Control-Allow-Origin:http://hello.local
Cache-Control:private, must-revalidate
Content-Language:en
Content-Type:application/json
Date:Thu, 22 Sep 2016 15:14:36 GMT
ETag:"e24a002b754612447c8be5660951f2296c685ca4"
Server:Apache
Set-Cookie:mediaplan=R3721135442; path=/; expires=Thu, 22-Sep-2016 16:28:31 GMT
Set-Cookie:mediaplanBAK=R129296274; path=/; expires=Thu, 22-Sep-2016 16:32:55 GMT
Set-Cookie:laravel_session=XXX---XXX; expires=Thu, 22-Sep-2016 17:14:36 GMT; Max-Age=7200; path=/; HttpOnly
Transfer-Encoding:chunked
Vary:Origin
X-Powered-By:PHP/7.0.8
X-RateLimit-Limit:100
X-RateLimit-Remaining:99
X-RateLimit-Reset:1474557576

But, when the same request uses an application/json content type, I have this response from server

Content-Encoding:gzip
Content-Length:185
Content-Type:text/html; charset=iso-8859-1
Date:Thu, 22 Sep 2016 15:15:40 GMT
Server:Apache
Set-Cookie:mediaplanBAK=R129294096; path=/; expires=Thu, 22-Sep-2016 16:26:16 GMT
Set-Cookie:mediaplan=R3721135442; path=/; expires=Thu, 22-Sep-2016 16:32:55 GMT
Vary:Accept-Encoding

There is no Access-Control-Allow-Origin header, so the js client doesn't handle the server response. Without CORS, everything is working fine (even with a JSON request). I can't figure why. Somebody has an idea ?

Error on fresh installation

Hi, i have installed Porto, and i have this issue on fresh installation
The Response content must be a string or object implementing __toString()

Change the folders structure

  • Delete the default app directory provided by Laravel.
  • Rename my src directory to app.
  • Directly use the Illuminate components from the Core Module.

Automate registering console commands

Instead of manually adding them to "app/Port/Console/ConsolePort.php”.

Also automate loading closure commands in "app/Port/Console/ConsolePort.php” the commands function uncomment and autoload. Then remove the SayWelcome commented out in porto

Application In Production! while database migrate

I am following the installation step by step and when I tried to migrate the database :
php artisan migrate

i got


  • Application In Production!     *
    

    Do you really wish to run this command? y/N [no]:

    y

    [PDOException]
    SQLSTATE[HY000] [2002] No such file or directory

ApplicationAuthentication syntax error

Hi @Mahmoudz,

I got new bugs in "app/Containers/Application/Middlewares/MiddlewaresLoaderTrait.php", on doing a GET REQUEST.

message: "syntax error, unexpected '->' (T_OBJECT_OPERATOR)", code: 4, status_code: 500,
on line 104 in:
return (App::make(\Dingo\Api\Http\Middleware\Auth::class))->handle($request, $next);

Shared functionality / base views

Hey @Mahmoudz ,

thank you for the amazing work so far. I hardly ever get excited because of a software architecture, but I did with Porto. Almost every decision just makes sense. Really what I've been looking for for a while already.

What I've been wondering is where to put shared functionality, like some custom array functions or base views. In Hello-API you put all the HTML in every WEB-View, making the web interface really not DRY. Is there a best practice for those use cases already?

Would it maybe make sense to have a third layer besides Containers and Port that is called Libraries and support the Containers?

Thanks once again and keep up the amazing work!

Demo site

Would you be able to add a demo site? I tried installing it but gave up after a couple of hickups. I simply wanted to see what it looks like / what it does once installed (especially the admin panel).


For the issues (just as a heads up)

I followed method B of installing. After I cloned the project and linked it to my homestead machine, i tried running php artisan containers:add User Welcome Authentication

screen shot 2016-11-30 at 10 48 23 am

I left that one be and did a composer install instead. Everything installed but there are dependencies that I do not have on my machine. I let that be since i can install them manually, although I know clients who will refuse to have these sort of dependencies on their servers.

One thing went wrong at the end of the script however:

screen shot 2016-11-30 at 10 53 14 am

I then simply tried to run php artisan and i received this:

screen shot 2016-11-30 at 10 53 58 am

Good initiative on this project. Looks like a lot of work and I would love to see a demo of it :)

404 not found

Hi! I'm just curious about Hello-API, reading the documentation I feel it's a really good starting point to create a brand new API using Laravel. So, I followed the installation instructions and everything seems to be fine. API responds. That's ok. The point is that the response from API is always 404.

curl -X POST -H "Accept: application/json" -F "[email protected]" -F "password=secret#pass" -F "name=John Doe" "http://api.mega.pro/register"

The answer is:

{"message":"404 Not Found","status_code":404}%

Am I forgetting something?

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.