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

Install/Setup Laravel Backpack #221

Merged
merged 29 commits into from
Jan 9, 2022
Merged

Install/Setup Laravel Backpack #221

merged 29 commits into from
Jan 9, 2022

Conversation

RobertoNittolo
Copy link
Collaborator

@RobertoNittolo RobertoNittolo commented Dec 30, 2021

Description

Closes #204
Install Laravel Backpack
Add CRUD actions for existing models
Add a restriction to allow only site admins to be able to access Backpack

How to access Backpack

Run the following command to install Backpack fully on your local php artisan vendor:publish --provider="Backpack\CRUD\BackpackServiceProvider" --tag=public
Create a user with a site admin role
Login in using a user account that has a site admin role
To access Laravel Backpack, navigate to the /admin route. https://localhost/admin
Once logged in you will see a sidebar with all the models accessible from Backpack.
Navigating to a model should allow for CRUD operations to be used

@RobertoNittolo RobertoNittolo added enhancement New feature or request back end labels Dec 30, 2021
@RobertoNittolo RobertoNittolo added this to the Sprint #5 milestone Dec 30, 2021
@RobertoNittolo RobertoNittolo self-assigned this Dec 30, 2021
@codeclimate
Copy link

codeclimate bot commented Dec 30, 2021

Code Climate has analyzed commit 0f9c17d and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 35.2% (90% is the threshold).

This pull request will bring the total coverage in the repository to 82.0% (-9.7% change).

View more on Code Climate.

@IanjhPhillips
Copy link
Collaborator

Is there any way to reduce the size of this PR?

@RobertoNittolo
Copy link
Collaborator Author

RobertoNittolo commented Jan 1, 2022

Is there any way to reduce the size of this PR?

The majority of the files were generated by installing Backpack. I think it will be inevitable that it will be a big pull request. I could perhaps make a new pull request for the roles/policies that still need to be implemented for this issue.

@m-triassi
Copy link
Contributor

Yeah it seems like this can be reduced in size by git ignoring that public/packages folder. It would mean though, that part of the installation / deploy procedure would be manually publishing those assets

https://backpackforlaravel.com/docs/4.1/faq#miscellaneous-1

Executive summary:

  • add /public/packages to gitignore,
  • run git rm --cached public/packages
  • commit that
  • add a note somewhere that to install backpack fully on your local you need to run php artisan vendor:publish --provider="Backpack\CRUD\BackpackServiceProvider" --tag=public

@RobertoNittolo RobertoNittolo marked this pull request as ready for review January 9, 2022 00:18
@m-triassi
Copy link
Contributor

Just as a heads up, everything looks fine here but im still hesitating on the coverage; im not sure how its going to work with the exclusion rule. i'm going to give it a once over tomorrow, one last time.

@sonarcloud
Copy link

sonarcloud bot commented Jan 9, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

0.0% 0.0% Coverage
2.4% 2.4% Duplication

Copy link
Contributor

@m-triassi m-triassi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok barring the coverage this seems fine — i added an exclusion rule for the Admin "controllers" to code climate. What i'm going to do is merge, and see if the projects coverage drops 10%, if it does, i will revert the commit.

@m-triassi m-triassi merged commit 5ada124 into main Jan 9, 2022
@m-triassi
Copy link
Contributor

Yep, Tanked the coverage, i think i can fix that though...

m-triassi added a commit that referenced this pull request Jan 9, 2022
@m-triassi
Copy link
Contributor

😵 ok that was a bit messy, but it should be resolved now. Just for total transparency we are excluding coverage on the Admin controller name space because they don't actually represent functionality, but rather configuration. Thus just like we wouldn't write tests for the /config files, we also wont write tests for these.

@m-triassi m-triassi mentioned this pull request Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back end enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Install + Set-up Laravel-Backback
3 participants