GithubHelp home page GithubHelp logo

dbfx / laravel-strapi Goto Github PK

View Code? Open in Web Editor NEW
46.0 2.0 24.0 86 KB

Laravel wrapper for using the Strapi headless CMS

Home Page: https://blakey.co

License: MIT License

PHP 100.00%
laravel laravel-package strapi strapi-cms hacktoberfest

laravel-strapi's People

Contributors

aps74 avatar dbfx avatar dependabot-preview[bot] avatar dependabot[bot] avatar frugan-dev avatar jorisdrenth avatar kfina91 avatar sietzekeuning avatar stubbs avatar vincentbean 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

laravel-strapi's Issues

Should PHP 7.4 be the default build target?

When creating new commits the various tools that run over the code before a commit default to PHP 7.4 and cause the checks to fail because there are features in the code that PHP 7.4 doesn't support (Union types for example.

Also, PHP 7.4 has been end of life since 2022, is it really worth the effort to maintain compatability at the expense of new features?

An unknown Strapi error was returned while calling Route http://127.0.0.1:8000/test/2

Discussed in #15

Originally posted by bast111 April 6, 2022
Hi guys, being fairly new to Laravel i wanted to start implement a strapi backend following that tutorial here

All worked fine at first, I created a route to fetch all my localites

Route::get('/test', function () {
    $strapi = new LaravelStrapi();
    return $localites = $strapi->collection('api/localites');
});

image

So I kept going and tried to create the route for one item

//Route pour 1 localite
Route::get('/test/{id}', function ($id) {
    $strapi = new LaravelStrapi();
    return $localites = $strapi->entry('api/localites', $id);
});

And this is what I get :
image

I can see that the api has been called successfully but I don't understand what is the problem
image

If anyonce can give me some insights would be really appreciated :) Thanks

Cache is not working

Installed version: v4.0.1

The cache key is using the encrypt() function which returns every time a different hash string in all the LaravelStrapi class methods,

$cacheKey = self::CACHE_KEY.'.'.__FUNCTION__.'.'.encrypt($endpoint);

The cache::remember always stores in the cache the same request but with a different $cacheKey

Proposal to fix the bug:

  • Using md5: $cacheKey = md5(self::CACHE_KEY . '.' . __FUNCTION__ . '.' . $endpoint);
  • Using sha1: $cacheKey = sha1(self::CACHE_KEY . '.' . __FUNCTION__ . '.' . $endpoint);

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.