nascent-africa/jetstrap

Jetstream routes can be accessed although I'm only using Breeze

kaiimran opened this issue · 4 comments

This is causing problems for people who only use Laravel Breeze, and never install jetstream at all.

To Reproduce

  1. Install fresh laravel 8 app and follow the official docs to use laravel Breeze
  2. Run:
composer require nascent-africa/jetstrap --dev
php artisan jetstrap:swap breeze-inertia
npm install && npm run dev
  1. Comment out everything in routes/auth.php
  2. You can still go to the routes like usual!
  3. Run "php artisan route:list" and you can see all the routes that you never created.

I discovered this problem when I want to change the route name. I remove the route in auth.php and create a new one in web.php. Then it turns out that both old and new routes can still be reached. Why are you adding all the jetstream files in vendor\nascent-africa\jetstrap\src\NascentAfrica\Jetstrap\ for people who only use Breeze: "php artisan jetstrap:swap breeze-inertia" ?

SOLUTION

After you use this package to update to bootstrap, you can just remove it:

  1. composer remove vendor/nascent-africa/jetstrap --dev
  2. Make sure everything is deleted in composer.json, composer.lock, \vendor\nascent-africa\jetstrap\
  3. Run php artisan route:cache if you still see the old page with error about missing controller in browser. It should show 404 | Not Found.
  4. Run php artisan route:list to confirm all the other routes have been removed.
  5. Remove this div too in resources\js\Pages\Auth\Register.vue
    div class="form-group" v-if="$page.props.jetstream.hasTermsAndPrivacyPolicyFeature">

Jetstream has been moved to dev dependency in Jetstrap's composer.json, so it shouldn't be included in your installation.

Apparently it appeared? Let's say it's not included, then why is in vue the <div v-if="$page.props.jetstream.hasTermsAndPrivacyPolicyFeature"> added here for breeze: https://github.com/nascent-africa/jetstrap/blob/v2.x/breeze/inertia/resources/js/Pages/Auth/Register.vue

Apparently it appeared? Let's say it's not included, then why is in vue the <div v-if="$page.props.jetstream.hasTermsAndPrivacyPolicyFeature"> added here for breeze: https://github.com/nascent-africa/jetstrap/blob/v2.x/breeze/inertia/resources/js/Pages/Auth/Register.vue

Ok, thanks for pointing that out, will fix this.

I think installing Jetstrap without the --dev flag will prevent installing all its dev dependencies. Will try that out and if it fixes the problem then i'll update the docs. I think that would make steps 3 and 4 optional.