Code Monkey home page Code Monkey logo

Comments (7)

Aminur670 avatar Aminur670 commented on June 6, 2024

Sorry, but we found same new issue. I think they are still updating this section in better way.
image

from leafapi.

nickelnext avatar nickelnext commented on June 6, 2024

The only way to get it working is downloading the MVC app, remove the SCHEMA (which reads from the json, which has WRONG properties) and uncomment the php lines that create the db.

After that, you can install the leafsAPI

from leafapi.

mychidarko avatar mychidarko commented on June 6, 2024

This problem was due to an update in Leaf MVC core, Leaf MVC has already received an update, Leaf API is scheduled to receive one today. In the meantime, you can manually update Aloe CLI by running this command composer require leafs/aloe.

You will also need to update your existing migrations to use the static capsule from leaf mvc core

if (!static::$capsule::schema()->hasTable("users")):
  static::$capsule::schema()->create("users", function (Blueprint $table) {
    $table->increments('id');
    $table->string('username');
    $table->string('name');
    $table->string('email')->unique();
    $table->timestamp('email_verified_at')->nullable();
    $table->string('password');
    $table->rememberToken();
    $table->timestamps();
  });
endif;

from leafapi.

mychidarko avatar mychidarko commented on June 6, 2024

@jhintringer your issue was caused by a different problem though, that's the absence of the db_charset and db_collation env variables

DB_CHARSET=utf8
DB_COLLATION=utf8_unicode_ci

from leafapi.

mychidarko avatar mychidarko commented on June 6, 2024

As promised, the update for Leaf API has just been published, you can now update to v2.2.

A few things to note, global functions json, markup, requestData and requestBody are no longer supported, you now need to use response()->json(), response()->markup, request()->get and request()->body respectively.

Note that request and response work just as they have in earlier versions.

response(["something" => "value"]);

// is the same as

response()->json(["something" => "value"]);

from leafapi.

nickelnext avatar nickelnext commented on June 6, 2024

Thank you for your update.

I want to point out that also some of the comments in the code were outdated.

Ie: if I create a controller exactly like the UserController already present in the project, by using the CLI, the

$this->auth does not exists.

Is that because the templating system doesn't work for some reason?. I had to use the static class Auth::id to check if the user is logged. While the template says to use $this

from leafapi.

mychidarko avatar mychidarko commented on June 6, 2024

Hi @nickelnext, thanks for pointing out the comments and auth feature. All of those have been fixed now.

from leafapi.

Related Issues (11)

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.