Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 8.x and Php 8.0 Support, fixes #8

Merged
merged 5 commits into from
Mar 24, 2021
Merged

Conversation

erikn69
Copy link
Contributor

@erikn69 erikn69 commented Feb 5, 2021

  • Laravel 8.x and PHP 8.0 Support
  • After #6 files with extension .json are not used in parseBonsai() because stripos('file.bonsai.json', '.js') !== false, so answer first if is a json file
  • Added blade directive add , example
    @bonsai('add','files.bonsai.json')
    also removed unnecessary breaks; and " ' " from cases
    Closes #7
    (sorry for my english)

@erikn69 erikn69 mentioned this pull request Feb 5, 2021
@erikn69
Copy link
Contributor Author

erikn69 commented Feb 11, 2021

@kaidesu Hi, maybe you has no time, but its a new bug the last merge

@kaidesu
Copy link
Contributor

kaidesu commented Feb 11, 2021

What's the use case for the add directive? This is meant to programmatically add assets to your application from the backend. For the frontend, you load your assets natively.

@erikn69
Copy link
Contributor Author

erikn69 commented Feb 11, 2021

@kaidesu of course in front end i can load my assets natively, but i'm using json files and need to load dinamically on blade views(i don´t wanna use @php @endphp), i means i need namespaces and depends from the bonsai.json, on updates is more easy update one json file that many blade views with the asset, is useful for me at least with json files(maybe nobody else are using bonsai.json because it's not in the documentation and the new bug went unnoticed), does not affect the above functionality, great addon by the way :)

@kaidesu
Copy link
Contributor

kaidesu commented Feb 12, 2021

I would argue that belongs in a view composer 👍 then you can natively use Bonsai as intended without muddying up your view files.

I'll accept this PR if you remove the add directive change - can open that as its own PR if you'd like to continue the discussion, but I do recommend using a view composer for this particular use case.

@erikn69
Copy link
Contributor Author

erikn69 commented Feb 12, 2021

They are partial views added with @include and components for example, i'm using view composer with the main views, but for that little piece of code I find it tedious

@erikn69 erikn69 closed this Feb 12, 2021
@erikn69 erikn69 reopened this Feb 17, 2021
@erikn69 erikn69 changed the title Laravel 8 Support, fixes, feature Laravel 8.x and Php 8.0 Support, fixes, feature Feb 18, 2021
@erikn69 erikn69 changed the title Laravel 8.x and Php 8.0 Support, fixes, feature Laravel 8.x and Php 8.0 Support, fixes Feb 23, 2021
@PaolaRuby
Copy link

@kaidesu ping :)

@erikn69
Copy link
Contributor Author

erikn69 commented Mar 12, 2021

@kaidesu ready for merge, tested in Laravel 8.32 and PHP 8.0.2

@kaidesu kaidesu merged commit 466603f into caffeinated:master Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Laravel 8 support?
3 participants