mstdmstd

mstdmstd

Member Since 2 Years Ago

Experience Points
13,100
Total
Experience

1,900 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
2
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 3
13,100 XP
Nov
22
10 hours ago
Activity icon

Started a new Conversation How To Show Server's Errors In My @vue/cli App?

Hello, In laravel 5 / vuejs 2.6 app I used VeeValidate and VeeValidateLaravel libraries to validate data both on client and server, like:

      updateFacility() {
             this.is_page_updating = true
             axios({
                 method: (this.is_insert ? 'post' : 'patch'),
                 url: window.API_BACKEND_VERSION_LINK + '/admin/facilities' + (!this.is_insert ? "/" + this.facility_id : ''),
                 data: this.$data.facilityRow,
             }).then((response) => {
                 this.is_page_updating = false
                 this.showPopupMessage("Facilities", 'Facility ' + (this.is_insert ? 'added' : 'updated') + ' successfully !', 'success');
                 this.$router.push({path: '/admin/facilities'});
             }).catch((error) => {
                 console.error(error)
                 this.$setLaravelValidationErrorsFromResponse(error.response.data);
                 this.is_page_updating = false
                 this.showPopupMessage("Facilities", 'Error ' + (this.is_insert ? 'adding' : 'updating') + ' facility !', 'warn');
             });

and when I got server's errors(like not unique name field) server's error was shown in my app too.

Now with @vue/cli 4.0.5 / vuex "^3.0.1" I make saving of data on different Laravel(6) REST API app, like :

register ({ commit }, user) {
   return new Promise((resolve, reject) => {
     commit('auth_request')
     let apiUrl = process.env.VUE_APP_API_URL
     axios({ url: apiUrl + '/register', data: user, method: 'POST' })
       .then(resp => {
         const token = resp.data.token
         const user = resp.data.user
         localStorage.setItem('token', token)
         axios.defaults.headers.common['Authorization'] = token
         commit('auth_success', token, user)
         resolve(resp)
       })
       .catch(err => {
         console.error(err)
         // this.$setLaravelValidationErrorsFromResponse(err.response.data)
         commit('auth_error', err)
         localStorage.removeItem('token')
         reject(err)
       })
   })
 } // register ({ commit }, user) {

and in the console of my browser(network tab) I see error :

{"error":{"email":["The email has already been taken."]}}

But this error in not filled in my vueErrorsList error and in console of my browser I see : https://imgur.com/a/Z3RYiVm If to uncomment line:

  this.$setLaravelValidationErrorsFromResponse(err.response.data)

In the console I see erres :

POST http://local-ctasks-api.com/api/register 401 (Unauthorized)
index.js?4360:92 Error: Request failed with status code 401
    at createError (createError.js?2d83:16)
    at settle (settle.js?467f:17)
    at XMLHttpRequest.handleLoad (xhr.js?b50d:59)
eval @ index.js?4360:92
Promise.catch (async)
eval @ index.js?4360:90
register @ index.js?4360:78
wrappedActionHandler @ vuex.esm.js?2f62:747
dispatch @ vuex.esm.js?2f62:438
boundDispatch @ vuex.esm.js?2f62:332
register @ Register.vue?0103:218
submit @ Register.vue?73da:27
invokeWithErrorHandling @ vue.runtime.esm.js?2b0e:1854
invoker @ vue.runtime.esm.js?2b0e:2179
original._wrapper @ vue.runtime.esm.js?2b0e:6911
index.js?4360:93 Uncaught (in promise) TypeError: _this2.$setLaravelValidationErrorsFromResponse is not a function
    at eval (index.js?4360:93)

In src/main.js I have defined :

import * as VeeValidate from 'vee-validate'
import VeeValidateLaravel from 'vee-validate-laravel' // https://github.com/RobertGlynWilliams/vee-validate-laravel

import { settingsTimeZone } from './../app.settings.js'

const veeValidateConfigArray = { // https://github.com/logaretm/vee-validate
  errorBagName: 'vueErrorsList', // change if property conflicts
  fieldsBagName: 'fields',
  delay: 0,
  locale: 'en',
  dictionary: null,
  strict: true,
  classes: false,
  classNames: {
    touched: 'touched', // the control has been blurred
    untouched: 'untouched', // the control hasn't been blurred
    valid: 'valid', // model is valid
    invalid: 'invalid', // model is invalid
    pristine: 'pristine', // control has not been interacted with
    dirty: 'dirty' // control has been interacted with
  },
  events: 'input|blur',
  inject: true,
  validity: false,
  aria: true
}
Vue.use(VeeValidate, veeValidateConfigArray)
Vue.use(VeeValidateLaravel)

Which is valid way to show server's errors in my @vue/cli app ?

in package.json :

{
  "name": "ctasks",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "axios": "^0.19.0",
    "core-js": "^3.3.2",
    "font-awesome": "^4.7.0",
    "moment": "^2.24.0",
    "moment-timezone": "^0.5.27",
    "vee-validate": "^2.2.5",
    "vee-validate-laravel": "^1.1.0",
    "vue": "^2.6.10",
    "vue-focus": "^2.1.0",
    "vue-js-modal": "^1.3.31",
    "vue-notification": "^1.3.20",
    "vue-router": "^3.1.3",
    "vue-select": "^3.2.0",
    "vuex": "^3.0.1"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "^4.0.0",
    "@vue/cli-plugin-eslint": "^4.0.0",
    "@vue/cli-plugin-router": "^4.0.0",
    "@vue/cli-plugin-vuex": "^4.0.0",
    "@vue/cli-service": "^4.0.0",
    "@vue/eslint-config-standard": "^4.0.0",
    "babel-eslint": "^10.0.3",
    "bootstrap": "^4.3.1",
    "eslint": "^5.16.0",
    "eslint-plugin-vue": "^5.0.0",
    "jquery": "^3.4.1",
    "node-sass": "^4.12.0",
    "popper.js": "^1.16.0",
    "sass-loader": "^8.0.0",
    "vue-template-compiler": "^2.6.10"
  }
}

Thanks!

Nov
16
6 days ago
Activity icon

Started a new Conversation Got Uncaught (in Promise) NavigationDuplicated Error On Invalid Credentials

Hello, In laravel 5 / vuejs 2.6 app I have login form and on login failure I got error :

app.js?dt=1571914585:131483 Uncaught (in promise) NavigationDuplicated {_name: "NavigationDuplicated", name: "NavigationDuplicated", message: "Navigating to current location ("/login") is not allowed", stack: "Error↵    at new NavigationDuplicated (http://127.…/127.0.0.1:8084/js/app.js?dt=1571914585:148080:12"}

I found where error is triggered! In my resources/js/app.js I have :

const router = new VueRouter({
    routes,
    mode: 'history'
});

checkAuthorization(store, router);
axios.interceptors.response.use(null, (error) => {

    if (error.response.status == 401) {

        store.commit('setLogout');
        
        console.log("0012 route.path::")
        console.log( $route )      // THAT OUTPUTS NOTHING
        console.log( $route.path ) // THAT OUTPUTS NOTHING

        router.push('/login');  // THAT RISE ERROR !
    }

    return Promise.reject(error);
});


const app = new Vue({
    el: '#app',
    router,
    store,
    bus,
    components: {
        mainapp, appheader, appfooter, navigation
    },
});


router.afterEach(( to, from ) => {
    bus.$emit('page_changed', from, to);
});

and line

router.push('/login');

raise this error, but I do not know how can I can I check current path

Here https://stackoverflow.com/questions/57837758/navigationduplicated-navigating-to-current-location-search-is-not-allowed/58439497#58439497 I found about possible decision and I read :

const path = `/products/${id}`
if ($route.path !== path) this.$router.push(path)
Note: $route is an object provided by vue-router to every component

But $route is empty. I think I need to get $route.path inside of axios.interceptors.response.use How can I do it ?

Nov
09
1 week ago
Activity icon

Started a new Conversation Error Is Raised On Seeding With Index Defined

Hello, In laravel 5.8 app I created migration file with 1 field and 1 index added

class SubscriptionsTableAddIsFreeField extends Migration
{
    public function up()
    {
        Schema::table('subscriptions', function (Blueprint $table) {
            $table->boolean('is_free')->default(false)->after('source_service_subscription_id');
            $table->index([ 'user_id', 'is_free' ], 'subscriptions_user_id_is_free_index');

        });
    }

    public function down()
    {
        Schema::table('subscriptions', function (Blueprint $table) {
            $table->dropForeign('subscriptions_user_id_is_free_index');
            $table->dropColumn('is_free');
        });
    }

But running command

php artisan migrate:refresh --seed

I got error :

: SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'subscriptions_user_id_is_free_index'; check that column/key exists (SQL: alter table `vt2_subscriptions` drop foreign key `subscriptions_user_id_is_free_index`)

  at /mnt/_work_sdb8/wwwroot/lar/votes/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664
    660|         // If an exception occurs when attempting to run a query, we'll format the error
    661|         // message to include the bindings with SQL, which will make this exception a
    662|         // lot more helpful to the developer instead of just the database's errors.
    663|         catch (Exception $e) {
  > 664|             throw new QueryException(
    665|                 $query, $this->prepareBindings($bindings), $e
    666|             );
    667|         }
    668| 

  Exception trace:

  1   Doctrine\DBAL\Driver\PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'subscriptions_user_id_is_free_index'; check that column/key exists")
      /mnt/_work_sdb8/wwwroot/lar/votes/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:119

  2   PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'subscriptions_user_id_is_free_index'; check that column/key exists")
      /mnt/_work_sdb8/wwwroot/lar/votes/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117

  Please use the argument -v to see more details.

What is wrong in defintion of my migration?

I know that laravel migration has methods

if (Schema::hasTable('users')) {
    //
}

if (Schema::hasColumn('users', 'email')) {
    //
}

But can I check indexes?

Thanks!

Nov
04
2 weeks ago
Activity icon

Replied to Using Laravel Cashier How To Fill Ends_at Fields?

Could, you, please share your expierence trial_ends_at and ends_at timestamp fields using Laravel Cashier ?

Nov
03
2 weeks ago
Activity icon

Started a new Conversation Using Laravel Cashier How To Fill Ends_at Fields?

Hello, In my Laravel 5.8 app using Laravel Cashier "^10.3" I have

subscriptions table, with trial_ends_at and ends_at timestamp fields and I want to clarify what are they for ? I suppose that trial_ends_at must be filled when user select Free(trial) subscription and ends_at must be filled when user select non free subscription and making subscription I do :

        $subscription_days_count       = config('app.subscription_days_count', 31);
        $free_subscription_days_count  = config('app.free_subscription_days_count', 31);
        $subscription_product_name     = config('app.subscription_product_name');

            $newSubscription = $user->newSubscription($subscription_product_name,
                $sourcePaymentPackage->stripe_plan_id)->create($requestData['purchaseDetails']['payment_token']);

            // I added 2 additive fields to subscriptions table and fill them 
            $newSubscription->source_payment_package_id = $requestData['purchaseDetails']['source_payment_package_id'];
            $newSubscription->is_free                   = $sourcePaymentPackage->is_free;
            if ( $sourcePaymentPackage->is_free ) {
                $newSubscription->trial_ends_at = Carbon::now()->addDays($free_subscription_days_count);
            } else {
                $newSubscription->ends_at = Carbon::now()->addDays($subscription_days_count);
            }
            $newSubscription->save();

But cancelling subscriptions with method:

            $ret = $userProfile->subscription($subscription_product_name)->cancelNow();

I see that in subscriptions table field ends_at is set to time of cancellation above. Is it configurable? Which way have I to follow ?

Thanks!

Oct
23
4 weeks ago
Activity icon

Started a new Conversation Defining Events In Stripe For Laravel Cashier

Hello, In my Laravel 5.8 app using Laravel Cashier I make subscription to Stripe Products and I want to create hooks for some events

Here https://laravel.com/docs/5.8/billing#handling-stripe-webhooks I found only some events I not I need

I need to create hooks for next events :

  1. user made payment(checkout or subscription)
  2. User created subscription
  3. User's subscription will expire in 3,2,1 day.

In stripe dashboard I added hook with some callback url and events: https://prnt.sc/pmwatm

But looks like that is not all I need. Which events have I to use? Please privide link to events and how Laravel Cashier can be used with it ?

Thanks!

Oct
20
1 month ago
Activity icon

Started a new Conversation How To Check If User Is Subscribed To Some Stripe's Plan

Hello, In my Laravel 5.8 I search how to check if used is subscribed to some stripe's plan. I make subscription with stripe and I have installed

        "stripe/stripe-php": "^7.2",
        "laravel/cashier": "^10.3",

In app/User.php :

use Laravel\Cashier\Billable;
...
class User extends Authenticatable implements MustVerifyEmail
{
    use Billable;
    use Notifiable;

When I ned to subscribe to stripe's plan I make :

      $ret= $user->newSubscription('main', 'plan_ID')->create($requestData['purchaseDetails']['payment_token']);
where plan_ID is id of plan registered at stripe dashboard

Searching for checking subscribed method I found and tried:

                if( Auth::user()->subscribed( 'main', $item['stripe_plan_id'] ) ) {
                    die("-1 XXZ ===  subscribed");
                }

I tried stripe_plan_id or stripe_plan_name - but failed in both cases

Also I tried :

$user->subscriptions

but it returned empty array. In Stripe dashboard I see that logged user is subscribed to stripe_plan_id... Which way is correct ?

Thanks!

Oct
19
1 month ago
Activity icon

Replied to Delete Old Versions Of App Inside App Directory

Do you mean that I need to modify file /etc/sudoers.d/lardeployer with content:

%lardeployer ALL=(ALL:ALL) NOPASSWD:rm . -R

and I need to remake my control command :

      foreach ($sortedDirectories as $next_directory) {
           if ( $index < count($sortedDirectories) - $leave_last_dirs ) {
               $process = new Process(['cd ' . $next_directory]);
               $ret= $process->run();
               echo '<pre>CD $next_directory $ret::'.print_r($ret,true).'</pre>';

               $process = new Process(['rm . -R -f']);
               $ret2= $process->run();
               echo '<pre>rm -R  $next_directory $ret2::'.print_r($ret2,true).'</pre>';
           }

In first Process command directory which must be deleted selected In the second Process command run command which is EXACT in /etc/sudoers.d/lardeployer ? In the second Process command directory to delete is not set, as it is selected by prior Process command? Sorry, I need to confirm it before testing, do not to harm my project installation...

Activity icon

Replied to Delete Old Versions Of App Inside App Directory

I tried to run command with my release/ directory set, but got a lot of messages :

[email protected]:/var/www/html/Hostels2Deployed/release$ ls -dt /var/www/html/Hostels2Deployed/release/* | tail -n +6 | xargs -d "\n" rm -rf
rm: cannot remove '/var/www/html/Hostels2Deployed/release/20191014-100335/storage/framework/cache/data/73/c8/73c809a4afed54c4bbecefb2c9ad0ddf443186e3': Permission denied
rm: cannot remove '/var/www/html/Hostels2Deployed/release/20191014-100335/storage/framework/cache/data/cf/10/cf102518168f920c93bd5d9fe8700022e9cd051a': Permission denied
rm: cannot remove '/var/www/html/Hostels2Deployed/release/20191014-100335/storage/framework/cache/data/ed/b2/edb27d7a1ff744451db32d8463dca06185b22cb9': Permission denied
rm: cannot remove '/var/www/html/Hostels2Deployed/release/20191014-100335/storage/framework/cache/data/4a/b9/4ab9b33153d12a429b21cb0f6033f2d5378b8696': Permission denied
rm: cannot remove '/var/www/html/Hostels2Deployed/release/20191014-100335/storage/framework/cache/data/98/81/988185469e9e3ea40ba3ec349f80f0d428d6406d': Permission denied
rm: cannot remove '/var/www/html/Hostels2Deployed/release/20191014-100335/storage/framework/cache/data/77/95/7795f2dafc065fe2cabbc3caa085a87ebe418b5c': Permission denied
rm: cannot remove '/var/www/html/Hostels2Deployed/release/20191014-100335/storage/framework/cache/data/be/c1/bec1c4b5db90d2ff5428dae76178dccd49037234': Permission denied
rm: cannot remove '/var/www/html/Hostels2Deployed/release/20191014-100335/storage/framework/cache/data/70/6a/706a89d06b079f5b075ffdb2d17a21bbe65a7f6c': Permission denied
rm: cannot remove '/var/www/html/Hostels2Deployed/release/20191014-100335/storage/framework/cache/data/cb/58/cb580d5a70f9f64d95e092e7779d3a748dafbf27': Permission denied
rm: cannot remove '/var/www/html/Hostels2Deployed/release/20191014-100335/storage/framework/cache/data/2f/62/2f62cac17cef65ffa697b2cbf72fa67ed63497a0': Permission denied
rm: cannot remove '/var/www/html/Hostels2Deployed/release/20191014-100335/storage/framework/cache/data/fc/f2/fcf2cdd8b287e30a25ed596bc2fb809912b98b5b': Permission denied

I looked into one of the directories and see that only 1 of subdirectories was not deleted :

[email protected]:/var/www/html/Hostels2Deployed/release/20190531-085456/storage/framework/cache/data$ ls -la
total 188
drwxr-xr-x 47 lardeployer www-data 4096 Oct 19 03:49 .
drwxr-xr-x  3 lardeployer www-data 4096 Oct 19 03:49 ..
drwxr-xr-x  3 www-data    www-data 4096 Jun 15 17:06 08
drwxr-xr-x  3 www-data    www-data 4096 May 31 07:18 0a
drwxr-xr-x  3 www-data    www-data 4096 Jun  9 09:49 15
drwxr-xr-x  3 www-data    www-data 4096 Jun  3 05:59 1f
drwxr-xr-x  3 www-data    www-data 4096 May 31 06:28 29
drwxr-xr-x  3 www-data    www-data 4096 Jun 20 01:08 2a
drwxr-xr-x  3 www-data    www-data 4096 May 31 06:27 2e
drwxr-xr-x  3 www-data    www-data 4096 Jun  9 09:49 30
drwxr-xr-x  3 www-data    www-data 4096 Jun  3 09:48 32
drwxr-xr-x  3 www-data    www-data 4096 Jun  3 08:12 39
drwxr-xr-x  4 www-data    www-data 4096 Jun 15 17:06 3c
drwxr-xr-x  3 www-data    www-data 4096 Jun 15 09:50 3d
drwxr-xr-x  3 www-data    www-data 4096 Jul  2 07:57 4b
drwxr-xr-x  3 www-data    www-data 4096 Jun  3 08:12 4e
drwxr-xr-x  3 www-data    www-data 4096 Jul  2 07:57 51
drwxr-xr-x  3 www-data    www-data 4096 Jun  9 09:49 54
drwxr-xr-x  4 www-data    www-data 4096 Jun  9 09:49 58
drwxr-xr-x  3 www-data    www-data 4096 Jun 10 18:16 69
drwxr-xr-x  3 www-data    www-data 4096 Jun  3 08:21 6f
drwxr-xr-x  3 www-data    www-data 4096 Jun 15 09:50 8c
drwxr-xr-x  3 www-data    www-data 4096 Jun  3 04:25 8f
drwxr-xr-x  3 www-data    www-data 4096 Jun 10 15:46 98
drwxr-xr-x  3 www-data    www-data 4096 May 31 07:18 a2
drwxr-xr-x  3 www-data    www-data 4096 Jun  9 09:49 a3
drwxr-xr-x  3 www-data    www-data 4096 Jun 17 02:48 a4
drwxr-xr-x  4 www-data    www-data 4096 Jun  9 09:49 a5
drwxr-xr-x  3 www-data    www-data 4096 Jun  3 05:59 a6
drwxr-xr-x  3 www-data    www-data 4096 Jun  3 08:45 b3
drwxr-xr-x  3 www-data    www-data 4096 Jun  3 04:25 b4
drwxr-xr-x  3 www-data    www-data 4096 Jun  9 09:49 b5
drwxr-xr-x  3 www-data    www-data 4096 Jun 15 17:06 bb
drwxr-xr-x  3 www-data    www-data 4096 Jun  3 08:45 c4
drwxr-xr-x  4 www-data    www-data 4096 Jun  9 09:49 cb
drwxr-xr-x  3 www-data    www-data 4096 Jun  3 09:48 d0
drwxr-xr-x  3 www-data    www-data 4096 Jun 20 01:08 d1
drwxr-xr-x  3 www-data    www-data 4096 Jun 17 02:48 e2
drwxr-xr-x  3 www-data    www-data 4096 Jun 15 17:06 e5
drwxr-xr-x  3 www-data    www-data 4096 Jun  3 08:19 e6
drwxr-xr-x  3 www-data    www-data 4096 Jun 10 15:46 ec
drwxr-xr-x  3 www-data    www-data 4096 May 31 05:55 ed
drwxr-xr-x  3 www-data    www-data 4096 Jul  2 07:57 ee
drwxr-xr-x  4 www-data    www-data 4096 Jun 10 18:16 f2
drwxr-xr-x  3 www-data    www-data 4096 Jun 10 15:20 f5
drwxr-xr-x  3 www-data    www-data 4096 Jun  3 08:19 f7
drwxr-xr-x  3 www-data    www-data 4096 Jul  2 07:57 fa

looks like lardeployer lack rights to delete these files, thouht it has sudo rights for rm. Why error and how fix it ?

Oct
18
1 month ago
Activity icon

Replied to Delete Old Versions Of App Inside App Directory

Yes, you are right. I logged as lardeployer and have :

who
lardeployer pts/0        2019-10-18 07:24 (213.109.234.130)
$ rm -R -f 20191018-063202
rm: cannot remove '20191018-063202/storage/framework/cache/data/ed/b2/edb27d7a1ff744451db32d8463dca06185b22cb9': Permission denied
rm: cannot remove '20191018-063202/storage/framework/cache/data/cb/58/cb580d5a70f9f64d95e092e7779d3a748dafbf27': Permission denied

Error on storage files which were generated by laravel app. Lacking of rights?

Activity icon

Replied to Delete Old Versions Of App Inside App Directory

I filled /etc/sudoers.d/lardeployer with :

%lardeployer ALL=(ALL:ALL) NOPASSWD:rm . -R

and I changed my laravel command which is run in the end of the envoy :

        foreach ($sortedDirectories as $next_directory) {
            echo '<pre>$index::'.print_r($index,true).'</pre>';
            if ( $index < count($sortedDirectories) - $leave_last_dirs ) {
                echo '<pre>CD AND DELETE $next_directory ::'.print_r($next_directory,true).'</pre>';


                $process = new Process(['cd ' . $next_directory]);
                $ret= $process->run();
                echo '<pre>CD $next_directory $ret::'.print_r($ret,true).'</pre>';

                $process = new Process(['rm -R ' . $next_directory]);
                $ret2= $process->run();
                echo '<pre>rm -R  $next_directory $ret2::'.print_r($ret2,true).'</pre>';
            }
            $index++;
        }

In output I see code 127(Command not found) returned for both process commands Copypasting path from the output I can select aNdelete the directory and check that after deletion the directory does not exists :

# cd /var/www/html/Hostels2Deployed/release/20190918-183334
[email protected]:/var/www/html/Hostels2Deployed/release/20190918-183334# rm -R  /var/www/html/Hostels2Deployed/release/20190918-183334
[email protected]:/var/www/html/Hostels2Deployed/release/20190918-183334# cd /var/www/html/Hostels2Deployed/release/20190918-183334
-bash: cd: /var/www/html/Hostels2Deployed/release/20190918-183334: No such file or directory

Why I got code 127 ?

Oct
17
1 month ago
Activity icon

Replied to Delete Old Versions Of App Inside App Directory

How to write if I need right to delete folders/files inside sopme specific directory ?

Activity icon

Replied to Delete Old Versions Of App Inside App Directory

I run it and it created empty file lardeployer in /etc/sudoers.d I filled it with your proposed content and restarted OS It did not help.

Could you please explain about format of it?

Activity icon

Replied to Delete Old Versions Of App Inside App Directory

Checking I do not see any /etc/sudoers.d/lardeployer file :

[email protected]:/etc/sudoers.d# ls -la
total 16
drwxr-x---   2 root root 4096 Oct 17 14:36 .
drwxr-xr-x 112 root root 4096 Oct 17 14:24 ..
-r--r-----   1 root root  147 Oct  3  2018 90-cloud-init-users
-r--r-----   1 root root  958 Jan 18  2018 README
[email protected]:/etc/sudoers.d# cat 90-cloud-init-users
# Created by cloud-init v. 18.3-9-g2e62cb8a-0ubuntu1~18.04.2 on Wed, 03 Oct 2018 09:58:17 +0000

# User rules for root
root ALL=(ALL) NOPASSWD:ALL

Have I to create it mannualy or with command? Which content? I use apache 2, had it be different with your example?

Activity icon

Replied to Delete Old Versions Of App Inside App Directory

As you wrote :

The tasks that need sudo i have handled by allowing the user to run them without password in the sudoers file on the server (and only them!)

When I create the user on server I do the following

sudo useradd lardeployer
sudo usermod -a -G sudo lardeployer

I suppose lardeployer has sudo access . I have Ubuntu 18.04.3 LTS under Digital Ocean... lardeployer lacks some rights ?

How do you delete old directories ?

Activity icon

Replied to Delete Old Versions Of App Inside App Directory

Sorry, no ideas? maybe it can be done in some other way ?

Oct
15
1 month ago
Activity icon

Started a new Conversation Delete Old Versions Of App Inside App Directory

Hello, In Laravel 5.8 app I use envoy to upload changes on the server(ubuntu 16) and I created user for connect with commands :

sudo useradd lardeployer
sudo usermod -a -G sudo lardeployer

It works ok, exclude part where I want to remove all old projects, excluding last 5. I run command with methods :

        echo '<pre>+++ 222 $sortedDirectories::'.print_r($sortedDirectories,true).'</pre>';
        $leave_last_dirs= 5;
        $index= 1;
        foreach ($sortedDirectories as $next_directory) {
            echo '<pre>$index::'.print_r($index,true).'</pre>';
            if ( $index < count($sortedDirectories) - $leave_last_dirs ) {
                echo '<pre>chmod SET AND DELETED $next_directory ::'.print_r($next_directory,true).'</pre>';

                $process = new Process(['chmod -R 777 ' . $next_directory]);
                $process->run();

                $process = new Process(['rm -R ' . $next_directory]);
                $process->run();
            }
            $index++;
        }

But in console I see a lot of messages like :

chmod:
[laravelserver]: changing permissions of '/var/www/html/Hostels2Deployed/release/20190623-064420/storage/framework/cache/data/cb/58': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190623-064420/storage/framework/cache/data/cb/58/cb580d5a70f9f64d95e092e7779d3a748dafbf27': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190623-064420/storage/framework/sessions/fkizWaUKI8Kn2zeGhD0AGw7yEcSpkIccRkwN8DTk': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190623-064420/storage/logs/logging_deb.txt': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/framework/views/60b1223e3e702f95a92a7025c325cdeb779f6ea0.php': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/framework/views/ef500fafc30acaec5d56ab3848bf574dbfdbfcdf.php': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/framework/cache/data/ed'
[laravelserver]: : Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/framework/cache/data/ed/b2': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/framework/cache/data/ed/b2/edb27d7a1ff744451db32d8463dca06185b22cb9': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/framework/cache/data/cb': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/framework/cache/data/cb/58': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/framework/cache/data/cb/58/cb580d5a70f9f64d95e092e7779d3a748dafbf27': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/framework/sessions/yBqH00BlyNKwITDGmPbS8sIX1eilsm6FR3bYJbju': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/logs/sql-tracing-.txt': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/logs/access.log': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/logs/logging_deb.txt': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/logs/error.log': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/logs/laravel-2019-10-10.log': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190830-140823/storage/framework/cache/data/ed': Operation not permitted
[laravelserver]: chmod:
[laravelserver]: changing permissions of '/var/www/html/Hostels2Deployed/release/20190830-140823/storage/framework/cache/data/ed/b2': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190830-140823/storage/framework/cache/data/ed/b2/edb27d7a1ff744451db32d8463dca06185b22cb9'
[laravelserver]: : Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190830-140823/storage/framework/cache/data/cb': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190830-140823/storage/framework/cache/data/cb/58': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190830-140823/storage/framework/cache/data/cb/58/cb580d5a70f9f64d95e092e7779d3a748dafbf27': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190924-183000/storage/framework/cache/data/ed': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190924-183000/storage/framework/cache/data/ed/b2': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190924-183000/storage/framework/cache/data/ed/b2/edb27d7a1ff744451db32d8463dca06185b22cb9': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190924-183000/storage/framework/cache/data/cb': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190924-183000/storage/framework/cache/data/cb/58': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190924-183000/storage/framework/cache/data/cb/58/cb580d5a70f9f64d95e092e7779d3a748dafbf27': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191003-171927/storage/framework/views/1974e76665576f11502d27ef004fe355049a2da5.php': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191003-171927/storage/framework/views/fc6e0d52676a06cc2d57569428bd65c821010061.php': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191003-171927/storage/framework/cache/data/ed'
[laravelserver]: : Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191003-171927/storage/framework/cache/data/ed/b2': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191003-171927/storage/framework/cache/data/ed/b2/edb27d7a1ff744451db32d8463dca06185b22cb9': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191003-171927/storage/framework/cache/data/cb': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191003-171927/storage/framework/cache/data/cb/58': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191003-171927/storage/framework/cache/data/cb/58/cb580d5a70f9f64d95e092e7779d3a748dafbf27': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191003-171927/storage/framework/sessions/zDSeTYbjYQlfyx6ZNfm4EMH5tZNqGc7vrBQLSv4t': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191003-171927/storage/logs/sql-tracing-.txt': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191003-171927/storage/logs/logging_deb.txt': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-104305/storage/framework/views/ae27261e40e8c0320687ce8d8fcdcc660134ce97.php': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-104305/storage/framework/views/5e67134644d48253ab3dc1eb0a4376a653ce1ac6.php': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-104305/storage/framework/cache/data/ed'
[laravelserver]: : Operation not permitted

Any ideas why error and how it can be fixed ?

Oct
14
1 month ago
Activity icon

Replied to How To Get And Download Current Db Dump ?

Yes, upload file for a user from app dashboard

Activity icon

Started a new Conversation How To Get And Download Current Db Dump ?

Hello, Can you advice are there in Laravel 5.8/mysql5 app to get and download current db dump ?

Thanks!

Oct
11
1 month ago
Activity icon

Replied to How To Add Stripe Elements In Vue2 From?

No I do not use Laravel Cashier. Still a bit confused how to make subscription from the token I have?

Activity icon

Replied to How To Add Stripe Elements In Vue2 From?

Yes, thanks!

I managed to trigger javascript pay function with returned data

{id: "tok_1FSLhsI5xQnnnnnnn", object: "token", card: {…}, client_ip: "21N.NNN.NNN.NNN", created: 1570791048, …}card: {id: "card_1FSLNNN", object: "card", address_city: null, address_country: null, address_line1: null, …}client_ip: "21N.NNN.NNN.NNN"created: 1570791048id: "tok_1FSLhsINNNNN"livemode: falseobject: "token"type: "card"used: false__proto__: Object

I suppose next I have to redirect to laravel control action with 1 parameter id: "tok_1FSLhsI5xQnnnnnnn"

public function subscribe_process(Request $request)
{

            $stripeConfig = config('services.stripe');
            Stripe::setApiKey( $stripeConfig['secret'] );

            $user = User::find(1);
            $user->newSubscription('Product 1', 'plan name')->create($request->stripeToken);

and $request->stripeToken == id: "tok_1FSLhsI5xQnnnnnnn" ?

Activity icon

Replied to How To Add Stripe Elements In Vue2 From?

Thank you for your help! I triied to install vue-stripe-elements into my app, but got console error :

[Vue warn]: Unknown custom element: <card> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
    found in
    ---> <SelectedSubscription> at

My vue file, with non stripe elements cut:

<template>

    <div class="page-content col-md-offset-2">

        <div class="sign-up container-fluid justify-content-center" style="max-width: 460px;">

            <div class="card m-2 p-2 shadow-none">
                <div class="card-body">

                    <div class="px-12">


                        <h1>Please give us your payment details:</h1>
                        <card class='stripe-card'
                              :class='{ complete }'
                              stripe='pk_test_NNNN'
                              :options='stripeOptions'
                              @change='complete = $event.complete'
                        />
                        <button class='pay-with-stripe' @click='pay' :disabled='!complete'>Pay with credit card</button>

                    </div>

                </div>
            </div>
        </div>
    </div>


</template>


<script>
    import { stripeKey, stripeOptions } from './stripeConfig.js'
    import { Card, createToken } from 'vue-stripe-elements-plus'

    import {bus} from '../../../../app';
    import appMixin from '../../../../appMixin';


    export default {
        data: function () {
            return {
                complete: false,
                stripeOptions: {
                    // see https://stripe.com/docs/stripe.js#element-options for details
                },

                components: { Card },

                packagesList: [
                ]

            }

        },
        name: 'selectedSubscription',

        created() {
        }, //  created) {

        mounted() {
        }, // mounted() {


        mixins: [appMixin],

        methods: {


            pay () {
                alert( "pay::"+(-66) )
                // createToken returns a Promise which resolves in a result object with
                // either a token or an error key.
                // See https://stripe.com/docs/api#tokens for the token object.
                // See https://stripe.com/docs/api#errors for the error object.
                // More general https://stripe.com/docs/stripe.js#stripe-create-token.
                createToken().then(data => console.log(data.token))
            },


        }, // methods: {

        computed: {

            currentLoggedUser() {
                return this.$store.getters.currentLoggedUser;
            },

        } //computed: {

    }


</script>

<style lang="css">

    .stripe-card {
        width: 300px;
        border: 1px solid grey;
    }
    .stripe-card.complete {
        border-color: green;
    }

</style>

I do not see why error, as I defined import and components for card as in sample.

Where is an error ?

Activity icon

Replied to How To Add Stripe Elements In Vue2 From?

But if that is a valid way why I do not see elements for card info entering? I expect to see components l;ike here : https://prnt.sc/phflkd What did I miss ?

Activity icon

Started a new Conversation How To Add Stripe Elements In Vue2 From?

Hello, In Laravel 5.8 / vuejs 2.6 / vuex / mysql app I need to add stripe elements from https://stripe.com/docs/stripe-js, http://prntscr.com/phflkd

and for this in resources/views/index.blade.php I added line:

@include('footer')
<script src="{{ asset('js/jquery.min.js') }}"></script>
<script src="{{ asset('js/bootstrap.bundle.min.js') }}"></script>
<script src="{{ asset('js/waves.min.js') }}"></script>
<script src="{{ asset('js/jquery.slimscroll.min.js') }}"></script>
<script src="{{ asset('js/powerange.js') }}"></script>
<script src="{{ asset('js/appInit.js') }}"></script>
<script src="{{ asset('js/app.js') }}{{  "?dt=".time()  }}"></script>

<script src="https://js.stripe.com/v3/"></script>

</html>

and in my vue form I init stripe in initStripe() method, which is called in mount event :

<template>

    <div class="page-content col-md-offset-2">

        <div class="sign-up container-fluid justify-content-center" style="max-width: 460px;">
                        <hr>
                        <hr>
                        <form action="/charge" method="post" id="payment-form">
                            <div class="form-row">
                                <label for="card-element">
                                    Credit or debit card
                                </label>
                                <div id="card-element">
                                    <!-- A Stripe Element will be inserted here. -->
                                </div>

                                <!-- Used to display form errors. -->
                                <div id="card-errors" role="alert"></div>
                            </div>

                            <button>Submit Payment</button>
                        </form>

                        <button type="button"
                                class="btn btn-outline-pink btn-round waves-effect waves-light cancel-btn mr-5" @click.prevent="cancelSelectedSubscription()">
                            <i :class="getHeaderIcon('cancel')"></i> Cancel
                        </button>


        </div>
    </div>


</template>


<script>
    import {bus} from '../../../../app';
    import appMixin from '../../../../appMixin';

    import Vue from 'vue';

    export default {
        data: function () {
            return {
                is_page_loaded: false,

            }

        },
        name: 'selectedSubscription',

        created() {

            if ( typeof this.currentLoggedUser.id != 'number' ) {
                this.showPopupMessage("Access", 'Your session is expired !', 'error');
                this.$store.commit('logout');
            }

            this.message = '';

        }, //  created) {

        mounted() {
            this.is_page_loaded = true
            this.setAppTitle("Selected Subscription", 'Selected Subscription Details', bus);
            this.initStripe();
        }, // mounted() {


        mixins: [appMixin],

        methods: {


            cancelSelectedSubscription() {
                this.$router.push({path: '/personal-details'});
            },

            initStripe()
            {

                console.log("Stripe -1::")

                // Create a Stripe client.
                var stripe = Stripe('pk_test_NNNN');
                console.log("Stripe -2::")

                // Create an instance of Elements.
                var elements = stripe.elements();
                console.log("Stripe -3::")

                // Custom styling can be passed to options when creating an Element.
                // (Note that this demo uses a wider set of styles than the guide below.)
                var style = {
                    base: {
                        color: '#32325d',
                        fontFamily: '"Helvetica Neue", Helvetica, sans-serif',
                        fontSmoothing: 'antialiased',
                        fontSize: '16px',
                        '::placeholder': {
                            color: '#aab7c4'
                        }
                    },
                    invalid: {
                        color: '#fa755a',
                        iconColor: '#fa755a'
                    }
                };

                // Create an instance of the card Element.
                var card = elements.create('card', {style: style});
                console.log("Stripe -4::")

                // Add an instance of the card Element into the `card-element` <div>.
                card.mount('#card-element');

                // Handle real-time validation errors from the card Element.
                card.addEventListener('change', function (event) {
                    var displayError = document.getElementById('card-errors');
                    if (event.error) {
                        displayError.textContent = event.error.message;
                    } else {
                        displayError.textContent = '';
                    }
                });
                console.log("Stripe -5::")

                // Handle form submission.
                var form = document.getElementById('payment-form');
                form.addEventListener('submit', function (event) {
                    event.preventDefault();

                    stripe.createToken(card).then(function (result) {
                        if (result.error) {
                            // Inform the user if there was an error.
                            var errorElement = document.getElementById('card-errors');
                            errorElement.textContent = result.error.message;
                        } else {
                            // Send the token to your server.
                            this.stripeTokenHandler(result.token);
                        }
                    });
                });

            }, // initStripe() {


            // Submit the form with the token ID.
            stripeTokenHandler(token) {
                // Insert the token ID into the form so it gets submitted to the server
                var form = document.getElementById('payment-form');
                alert( "stripeTokenHandler form::"+var_dump(form) )
                var hiddenInput = document.createElement('input');
                hiddenInput.setAttribute('type', 'hidden');
                hiddenInput.setAttribute('name', 'stripeToken');
                hiddenInput.setAttribute('value', token.id);
                form.appendChild(hiddenInput);

                // Submit the form
                form.submit();
            },

        }, // methods: {

        computed: {
            currentLoggedUser() {
                return this.$store.getters.currentLoggedUser;
            },
            ...
        } //computed: {

    }


</script>

<style lang="css">

    /**
 * The CSS shown here will not be introduced in the Quickstart guide, but shows
 * how you can use CSS to style your Element's container.
 */
    .StripeElement {
        box-sizing: border-box;

        height: 40px;

        padding: 10px 12px;

        border: 1px solid transparent;
        border-radius: 4px;
        background-color: white;

        box-shadow: 0 1px 3px 0 #e6ebf1;
        -webkit-transition: box-shadow 150ms ease;
        transition: box-shadow 150ms ease;
    }

    .StripeElement--focus {
        box-shadow: 0 1px 3px 0 #cfd7df;
    }

    .StripeElement--invalid {
        border-color: #fa755a;
    }

    .StripeElement--webkit-autofill {
        background-color: #fefde5 !important;
    }

</style>

As result in browser's console I see console messages, Credit or debit card label and uncolored Submit Payment button : https://imgur.com/a/TRWc23I

If to click on Submit Payment button I see :https://imgur.com/a/CdBSfMC

Is way I added Stripe to my vue form invalid? Which is valid way? I suppose that I do not have to insert any additive elements/code in this block :

    <div id="card-element">
        <!-- A Stripe Element will be inserted here. -->
   </div>

and they must be uploaded automatically on my form upload ?

and which method have I to use as in my app I save my data with axios?

Oct
10
1 month ago
Activity icon

Started a new Conversation How Correctly To Installed Vue-stripe-checkout Component ?

Hello, In Laravel 5.8 / vuejs 2.6 app I installed vue-stripe-checkout, which I want to use for subscriptions.

I tried to install vue-stripe-checkout in my vue page, but got error :

app.js?dt=1570690039:73374 [Vue warn]: Unknown custom element: <vue-stripe-checkout> - did you register the component correctly?
    For recursive components, make sure to provide the "name" option.

my vue file:

<template>

    <div class="page-content col-md-offset-3">


        <div>
            <vue-stripe-checkout
                ref="checkoutRef"
                :image="image"
                :name="name"
                :description="description"
                :currency="currency"
                :amount="amount"
                :allow-remember-me="false"
                @done="done"
                @opened="opened"
                @closed="closed"
                @canceled="canceled"
            ></vue-stripe-checkout>
            <button @click="checkout">Checkout</button>
        </div>


        </div>
    </div>


</template>
<script>
    import {bus} from '../../../../app';
    import appMixin from '../../../../appMixin';


    import Vue from 'vue';
    import VueStripeCheckout from 'vue-stripe-checkout';
    Vue.use(VueStripeCheckout, 'pk_test_NNNN');

    export default {
        components: {
            // 'vue-stripe-checkout': VueStripeCheckout,
            // 'vue-stripe-checkout'
        },
        data: function () {
            return {
                ...
                image: 'https://i.imgur.com/HhqxVCW.jpg',
                name: 'Shut up and take my money!',
                description: 'Cats are the best dog!',
                currency: 'PHP',
                amount: 99999
            }

        },
        name: 'PersonalDetails',


        created() {
            if ( typeof this.currentLoggedUser.id != 'number' ) {
                this.showPopupMessage("Access", 'Your session is expired !', 'error');
                this.$store.commit('logout');
            }

        }, //  created() {

        mounted() {
        }, // mounted() {


        mixins: [appMixin],

        methods: {
            ...
        }, // methods: {

        computed: {
        }, //computed: {

    }

</script>
I tried to uncomment one of lines in components, but then error was different :
    app.js?dt=1570690191:73375 [Vue warn]: Failed to mount component: template or render function not defined.
    found in
    ---> <VueStripeCheckout>

How correctly to use this component ?

Thanks!

    Thanks!
Oct
09
1 month ago
Activity icon

Replied to No Access To .ssh/config With Envoy

I removed indents, spaces - the same error... I cleared all config file and still the same error Actually I copied this config file from prior installation.

Can the reason be that ssh, config must be member of some group?

Activity icon

Replied to No Access To .ssh/config With Envoy

It raise error :

[email protected]:/home/serge/.ssh# ssh -v laravelserver
OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
ssh: Could not resolve hostname laravelserver: Name or service not known
[email protected]:/home/serge/.ssh# ls -la
total 52
drwx------  2 serge serge 4096 �����  6 18:17 .
drwxr-xr-x 29 serge serge 4096 �����  9 07:35 ..
-rwxrwxrwx  1 root  root   398 ����� 26  2019 authorized_keys
-rwx------  1 root  root   301 ����� 26 13:40 config
-rwxrwxrwx  1 root  root  1679 ����� 25  2018 id_rsa
-rwxrwxrwx  1 root  root   426 �����  3  2018 id_rsa.pem
-rwxrwxrwx  1 root  root   393 ����� 25  2018 id_rsa.pub
-rwxrwxrwx  1 root  root  8760 �����  4 12:59 known_hosts
-rwxrwxrwx  1 root  root  8760 �����  6 17:47 known_hosts.old
[email protected]:/home/serge/.ssh# cat config
Host bitbucket.org
    IdentityFile ~/.ssh/id_rsa
    Hostname bitbucket.org
    User git 
    
Host github.com
    IdentityFile ~/.ssh/id_rsa
    Hostname github.com
    User git 

    
Host laravelserver
    IdentityFile ~/.ssh/id_rsa
    HostName NNN.NN.NNN.NN
    Port 22
    User lardeployer

I have ~/.ssh/id_rsa file and I can login successfully with command :

ssh [email protected]

?

Oct
08
1 month ago
Activity icon

Started a new Conversation No Access To .ssh/config With Envoy

Hello, After reinstall Kubuntu 18 I have problems with run envoy with ssh. I set 700 to config file, but got error anyway:

    $ sudo chmod  700  /home/serge/.ssh/config
    [email protected]:/mnt/_work_sdb8/wwwroot/lar/hostels2$ envoy run Hostels2Deploy  --app_version=0.112 --run_migration=1   --run_migration_seed=1                                                                                                   
    PHP Warning:  file_get_contents(/home/serge/.ssh/config): failed to open stream: Permission denied in /home/serge/.composer/vendor/laravel/envoy/src/SSHConfigFile.php on line 35                                                            
                                                                                                                                                                                                                                                 
    Warning: file_get_contents(/home/serge/.ssh/config): failed to open stream: Permission denied in /home/serge/.composer/vendor/laravel/envoy/src/SSHConfigFile.php on line 35                                                                 
    [laravelserver]: ssh: Could not resolve hostname laravelserver: Name or service not known                                                                                                                                                    
    This task did not complete successfully on one of your servers.   

It does not look like issue with envoy file, as it worked before Kubuntu reinstallation Searching for decision I run next :

sudo chmod -R 777 /home/serge/.composer/config.json
sudo chown serge /home/serge/.composer/config.json

But I got message that /home/serge/.composer/config.json not found. then I take it from prior home instalation with content :

{
    "require": {
        "laravel/envoy": "^1.6",
        "laravel/installer": "~1.1"
    }
}



and run

sudo service sshd restart

But still got this error. I have :

$ composer -v
...
Composer 1.6.3 2018-01-31 16:28:17

Somethimg wrong with composer or its permittions, as I did not have /home/serge/.composer/config.json file?

which steps to take ?

Sep
30
1 month ago
Activity icon

Replied to Method File::deleteDirectory Leaves Some Subdirectories Non Deleted

But that is not public directory, where I delete files/subdirectories. I try to delete old installed versions in /var/www/html/Hostels2Deployed/release/ directory. Does PHP/laravel has some methods of removing directory with all content. I hoped File::deleteDirectory does this...

Activity icon

Replied to JWT Token Signature Could Not Be Verified Error With External API Login

Reading jwt docs I found here https://github.com/tymondesigns/jwt-auth/wiki/Authentication :

Of course you can also manually set the token aswell, as needed if there are other entry points into your application. e.g.

JWTAuth::setToken('foo.bar.baz');

So In my login control when I recieved token from external API I wrote :

    $logged_user_token = $respArray->data->token;
    ...
    $loggedUser= $respArray->data->customer_details;
    \JWTAuth::setToken($logged_user_token);
    return response()->json(['error_code' => 0, 'message' => '', "token" => $logged_user_token, 'user'=> $loggedUser ], HTTP_RESPONSE_OK );

But running this login method and refering control's action when I read data from db I got the same error :

JWT Token Signature could not be verified.

I found method in vendor/tymon/jwt-auth/src/JWT.php :

    /**
     * Set the token.
     *
     * @param  \Tymon\JWTAuth\Token|string  $token
     *
     * @return $this
     */
    public function setToken($token)
    {
        $this->token = $token instanceof Token ? $token : new Token($token);

        return $this;
    }

and see that $token parameter can be Token or string and then it must be converted to Token object. But if I sent a string token from external API how have I render to it?

Does JWT has any apply/flash method to apply my new toaken to JWT ?

Sep
29
1 month ago
Activity icon

Started a new Conversation JWT Token Signature Could Not Be Verified Error With External API Login

Hello, In Laravel 5.8 / vuejs / vuex / mysql app I use jwt-auth and when I login into the system (standart auth with mysql users table) I use method :

export function setAuthorizationToken(token) {
    axios.defaults.headers.common["Authorization"] = `Bearer ${token}`
}

and it worked ok.

Next I remade SignUp/SignIn to use external API for SignUp/SignIn operations. So my app needs to make SignUp/SignIn with external API , but also I have requests for controls of my app to read/write data from/to mysql.

I remade SignIn request to external API with php curl in control action when user clicks SignIn button, like :

public function login(Request $request)
  {
      $credentials = $request->only('email', 'password');

 // I run login method
          $ch = curl_init();
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

          curl_setopt($ch, CURLOPT_URL, $this->admindashApi . '/api/login');
          curl_setopt($ch, CURLOPT_POST, 1);
          curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json; charset=utf-8"));

          $userLoginData = [
              'email'    => $credentials['email'],
              'password' => $credentials['password'],
          ];
          curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($userLoginData));

          $resp = curl_exec($ch);

          $respArray = json_decode($resp);
          if ( isset($respArray->success) and empty($respArray->success)) { // login fails - return error in responce
              $err = curl_error($ch);
              curl_close($ch);

              $errorsArray     = [$respArray->data];
              $errors_message  = $respArray->data;

              return response()->json([
                  'error_code' => 1,
                  'message'    => $errors_message,
                  'errors'     => $errorsArray,
                  'rows_total' => 0,
              ], HTTP_RESPONSE_BAD_REQUEST /*HTTP_RESPONSE_INTERNAL_SERVER_ERROR*/);

          } //if ( isset($respArray->success) and empty($respArray->success)) { // login fail

          $logged_user_token = $respArray->data->token;
          // if login was successfull I keep token





           // I need to get details of the logged user
          $loggedUser= null;

          $ch = curl_init();
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

          curl_setopt($ch, CURLOPT_URL, $this->admindashApi . '/api/user');

          curl_setopt($ch, CURLOPT_HTTPHEADER, [
              "Content-Type: application/json; charset=utf-8",
              "Authorization: Bearer ".$logged_user_token
          ]);


          $resp = curl_exec($ch);

          $respArray = json_decode($resp);
          if ( isset($respArray->success) and empty($respArray->success)) { // details read fails - return error in responce
              $err = curl_error($ch);
              curl_close($ch);

              $errorsArray     = [$respArray->data];
              $errors_message  = $respArray->data;

              return response()->json([
                  'error_code' => 1,
                  'message'    => $errors_message,
                  'errors'     => $errorsArray,
                  'rows_total' => 0,
              ], HTTP_RESPONSE_BAD_REQUEST );

          } //if ( isset($respArray->success) and empty($respArray->success)) {
          $loggedUser= $respArray->data->customer_details;

//            $this->respondWithToken($logged_user_token);

          return response()->json(['error_code' => 0, 'message' => '', "token" => $logged_user_token, 'user'=> $loggedUser ], HTTP_RESPONSE_OK );
          // if user details read was successfull I return logged user

      }   // if( !empty($this->useAdmindashApi) and !empty($this->admindashApi)) {

But the problem is whe I read data from my mysql db with app controls, I got Token Signature could not be verified in console. I suppose that jwt-auth knows nothing about token I read from external API in $logged_user_token var. Is there is a way to write value from $logged_user_token to jwt-auth token in my control above ?

flow is:

  1. User open login page
  2. enter his credentials and run external api login request with user details
  3. on success in the system O keep token and logged user info
  4. user can open any app page, but some of them have search functionality
  5. When user select search criteria and click search axios request '/personal/search-results' is run with mentioned error

In routes/api.php I have search-results described

Route::group(['middleware' => 'jwt.auth',  'prefix' => 'personal', 'as' => 'personal.'], function ($router) {
    ...
    Route::post('search-results', '[email protected]_search_web');
    ...
});

and I got the error on first control method request like :

                axios.post(window.API_VERSION_LINK + '/personal/search-results', filters).then((response) => {
                    this.is_page_loaded = true
                    ...
                }).catch((error) => {
                    this.showPopupMessage("Search", error.response.data.message, 'error');
                    this.is_page_loaded = true
                    this.showRunTimeError(error, this);
                });

I search some simple method like JWT::UseThis stringAsToken($string), if it exists ...

Kubuntu 18
"laravel/framework": "5.8.*",
"tymon/jwt-auth": "^1.0.0",


"vue": "^2.5.17",
"axios": "^0.18",
"vuex": "^3.1.0"

Thanks!

Sep
28
1 month ago
Activity icon

Started a new Conversation Method File::deleteDirectory Leaves Some Subdirectories Non Deleted

In my laravel 5.8 app in envoy task I delete old derectories with method :

use Illuminate\Support\Facades\File;
   ...
   
   File::deleteDirectory($directory_name);

But opening server's dirs I see that directories are not delete, but have some subdirectories inside. When the 1 directory is not deleted, like removing directory

/var/www/html/Hostels2Deployed/release/20190725-191130 

I found it with 1 subdirectory

/var/www/html/Hostels2Deployed/release/20190725-191130/storage/framework/cache/data# ls -la
total 16
drwxrwxrwx 4 lardeployer www-data 4096 Sep 27 11:59 .
drwxrwxrwx 3 lardeployer www-data 4096 Sep 27 11:59 ..
drwxr-xr-x 3 www-data    www-data 4096 Jul 25 16:12 cb
drwxr-xr-x 3 www-data    www-data 4096 Jul 25 16:12 ed

Why they are not deleted and how to delete it?

Thanks!

Sep
26
1 month ago
Activity icon

Replied to I Got Token Signature Could Not Be Verified With External API And Internal Requests In My App

Admin of my sever used this option https://support.cloudways.com/enable-cors-headers/ and enabled CORS headers and restartes debian, but I still get CORS errors. Any ideas how to fix problem ?

Activity icon

Replied to I Got Token Signature Could Not Be Verified With External API And Internal Requests In My App

Searching for a decision on login I keen token I got in cookie 'external_token'


                        const headers = {
                            'Content-Type': 'application/json',
                            'X-Auth-Token': getCookie('external_token'),
                            'Access-Control-Allow-Origin' : '*',
                            "Access-Control-Allow-Methods": "GET",
                        };
                        axios.get(user_details_url, headers)
                            .then((response) => {
                            ...
                            })
                            .catch((err) =>{
                            })

But I got error in console :

Access to XMLHttpRequest at 'http://remoteserver.com/api/user' from origin 'http://local-wiznext.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

where remoteserver.com is remote server with API and http://local-wiznext.com is my local server I am developing at

Searching for a decision I found several additive parameters to add to header of my axios request :

                        const headers = {
                            'Content-Type': 'application/json',
                            'X-Auth-Token': getCookie('external_token'),
                            'Access-Control-Allow-Origin' : '*',
                            "Access-Control-Allow-Methods": "GET",
                            'crossDomain': true,
                           'dataType': 'jsonp',
                        };

But I got the same CORS error. If there is a way to fix this error and run request?

Sep
25
1 month ago
Activity icon

Started a new Conversation I Got Token Signature Could Not Be Verified With External API And Internal Requests In My App

Hello, In Laravel 5.8 / vuejs / vuex / mysql app I use jwt-auth and when I login into the system (standart auth with mysql users table) I use method :

export function setAuthorizationToken(token) {
    axios.defaults.headers.common["Authorization"] = `Bearer ${token}`
}

and it worked ok.

Next I need to remade SignUp/SignIn to use external API for SignUp/SignIn operations. So my app needs to make SignUp/SignIn with external API , but also I have requests for controls of my app to read/write data from/to my sql.

SignIn request to external API returns token only and I keep it in the setAuthorizationToken method above. Next I need to read user details from this external API and to save it in vuex store. I make it and it works ok, but the problem is that my next axios request to my control to read data from db triggers error:

Token Signature could not be verified. I understand why but it there is a way to fix it? Is it possible to replace Bearer for axios when I need it? Maybe some replacement of axios to to use both axios and replacement ?

"laravel/framework": "5.8.*",
"tymon/jwt-auth": "^1.0.0",


"vue": "^2.5.17",
"axios": "^0.18",
"vuex": "^3.1.0"

Thanks!

Sep
24
1 month ago
Activity icon

Started a new Conversation Use Coingate As Wrapper For Stripe / PayPal / Crypto ?

Hello, In Laravel 5.8 app I need logged user make subscription selecting one of Stripe / PayPal / crypto to make subscription. I have big expierence with paypal, including subscriptions. I have some expierence with Stripe, but mostly expreds, when user makes 1 payment I have no expierence with crypto I got a hint that with https://github.com/coingate/coingate-php library I can simplify developmet with payment methods above. Who worked with it? is it so? If there is a sense to use this wrapper(or search some other) . Does it really simplify development?

Thanks!

Sep
21
2 months ago
Activity icon

Started a new Conversation If Logged With Jwt-auth Looks In Controller Auth::user() Is Empty

Hello, In my Laravel 5.8/vuejs 2.6 app I use "tymon/jwt-auth": "^1.0.0", and my app/Http/Controllers/AuthController.php has method:

    public function login(Request $request)
    {
        $credentials = $request->only('email', 'password');
        if ($token = $this->guard('api')->attempt($credentials)) {
            return $this->respondWithToken($token);
        }

        return response()->json(['error' => 'Unauthorized'], 401);
    }

and I keep token on client side. It works but I want to add more checks on the server's side, when I save data and to make in control's method :

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use Auth;
use DB;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Validator;

use App\Settings;
use App\Http\Traits\funcsTrait;
use App\Forum;
use App\ForumCategory;
use App\ForumThread;
use App\ForumPost;
use Illuminate\Routing\Controller as BaseController;

use App\User;
use App\library\CheckValueType;

use App\Http\Requests\ForumThreadRequest;
use JavaScript;


class ForumController extends BaseController
{
    use funcsTrait;

    public function __construct()
    {
        $this->middleware('auth');
    }


    public function add_new_thread(ForumThreadRequest $request)
    {

        $loggedUser = Auth::user();

        if ( empty($loggedUser->id) ) {
            return response()->json(['error_code'=> 1, 'message'=> "You must be logged!", 'forumThreadRow'=>null],HTTP_RESPONSE_INTERNAL_SERVER_ERROR);
        }
        try {

But even if I have logged into the system it looks like that in add_new_thread method $loggedUser is empty. Have I to make some additive actions in login method of AuthController.php or in which way ?

Sep
20
2 months ago
Activity icon

Replied to Do We Need "www." In Site Domains?

Actually I mean different error situations : creating app infacebook, google services or paypal I need to sign 1 address and it could be only "www." or without. I can not apply str_replace on facebook side. Seems I have to get rid of "www.", but how better to make if my app is referenced with "www." ?

Activity icon

Started a new Conversation Do We Need "www." In Site Domains?

Hello, Looking at some samples how to set domains with freenom I created 2 domains https://www.mysite.com and https://mysite.com, but it looks that somethimes it raise problems, when using external libraries like socialite login with faceboo, google services or paypal. Say when APP_URL without www. but redirect service www....

Do we need "www." in site domains now ? And which way it can be treated, bearing in mind that I gave to my clients urls both www. and not ? In laravel 5.8 app .

Thanks!

Activity icon

Replied to Error Testing With User Creation And Triggering Button Click

  1. I removed /vendor/ dir, lock and cache file in boostrap dir and run
composer install

but anyway app()->environment() returns local But is this critical to the question I started?

  1. i copied phpunit.xml from other project but anyway app()->environment() returns local Where can be this option configured ?
Sep
19
2 months ago
Activity icon

Replied to Error Testing With User Creation And Triggering Button Click


$ ls -1 .?*
.env
.env.example
.env.testing
.gitattributes
.gitignore

..:
ArtistsRating
BoxBooking2
cprods
csvp
DEMO-SEARCH
DeploymentApps
__DesignSamples
DockerApps
dropbox_demo.zip
dropbox_test
dusk_test
Examples
ExamplesDemo
Hostels2
Hostels2_BADSIDEBAR
info.php
laravel-server
lprods
ltests
nt_spa
rest_demo
RooterTest
tasks
TasksBs41
'__TasksFor future'
test_app
unittests
votes
__VueTemplates
wbsp
wiznext
WSTest

.git:
branches
COMMIT_EDITMSG
config
description
FETCH_HEAD
HEAD
hooks
index
info
logs
objects
ORIG_HEAD
packed-refs
refs

.idea:
codeStyles
codeStyleSettings.xml
inspectionProfiles
misc.xml
modules.xml
php.xml
vcs.xml
votes.iml
workspace.xml

Activity icon

Replied to Error Testing With User Creation And Triggering Button Click

$ ls -1
123.txt
1.htm
1.txt
2.txt
app
artisan
bootstrap
composer.json
composer.lock
config
database
__DOCS
Envoy.blade.php
git_pull
git_push
htpps.txt
https_q.txt
netstat.txt
node_modules
package.json
package-lock.json
PaypalDescripttion.txt
phpunit.xml
public
q.php
readme.txt
recreate_storage
resources
routes
server.php
__SQL
storage
test.html
tests
vendor
webpack.mix.js
yarn.lock
Activity icon

Replied to Error Testing With User Creation And Triggering Button Click

[email protected]:/_wwwroot/lar/votes$ php artisan config:clear?

                                           
  Command "config:clear?" is not defined.  
                                           
  Did you mean one of these?               
      activitylog:clean                    
      backup:clean                         
      cache:clear                          
      clockwork:clean                      
      config:cache                         
      config:clear                         
      debugbar:clear                       
      event:clear                          
      optimize:clear                       
      route:clear                          
      view:clear                                                                                                                                                                                                                             
                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                             
[email protected]:/_wwwroot/lar/votes$ php artisan config:cache                                                                                                                                                                             
Configuration cache cleared!                                                                                                                                                                                                                 
Configuration cached successfully!                                                                                                                                                                                                           
[email protected]:/_wwwroot/lar/votes$ ./vendor/bin/phpunit   tests/Feature/ProfilepageTest.php                                                                                                                                             
PHPUnit 7.5.16 by Sebastian Bergmann and contributors.                                                                                                                                                                                       
                                                                                                                                                                                                                                             
Runtime:       PHP 7.2.19-0ubuntu0.18.04.2                                                                                                                                                                                                   
Configuration: /mnt/_work_sdb8/wwwroot/lar/votes/phpunit.xml                                                                                                                                                                                 
                                                                                                                                                                                                                                             
"local"
Activity icon

Replied to Error Testing With User Creation And Triggering Button Click

:/_wwwroot/lar/votes$ vendor/bin/phpunit tests/Feature/ProfilepageTest.php --configuration phpunit.xml
PHPUnit 7.5.16 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.2.19-0ubuntu0.18.04.2
Configuration: /mnt/_work_sdb8/wwwroot/lar/votes/phpunit.xml

"local"

/mnt/_work_sdb8/wwwroot/lar/votes/ - is root of my app

Activity icon

Replied to Error Testing With User Creation And Triggering Button Click

running

./vendor/bin/phpunit   tests/Feature/ProfilepageTest.php

in the root of my app returns the same

Runtime:       PHP 7.2.19-0ubuntu0.18.04.2
Configuration: /mnt/_work_sdb8/wwwroot/lar/votes/phpunit.xml

"local"
Activity icon

Replied to Error Testing With User Creation And Triggering Button Click

my command is

vendor/bin/phpunit   tests/Feature/ProfilepageTest.php

?

Activity icon

Replied to Error Testing With User Creation And Triggering Button Click

In phpunit.xml I have :

<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         bootstrap="vendor/autoload.php"
         colors="true"
         verbose="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="false"
         stopOnFailure="true">
    <testsuites>
        <testsuite name="Unit">
            <directory suffix="Test.php">./tests/Unit</directory>
        </testsuite>
        
        <testsuite name="Feature">
            <directory suffix="Test.php">./tests/Feature</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./app</directory>
        </whitelist>
    </filter>
    <php>
        <env name="APP_ENV" value="testing"/>

        <env name="DB_CONNECTION" value="sqliteRRR"/>
        <env name="DB_DATABASE" value=":memoryTTT:"/>

        <env name="BCRYPT_ROUNDS" value="4"/>
        <env name="CACHE_DRIVER" value="array"/>
        <env name="SESSION_DRIVER" value="array"/>
        <env name="QUEUE_DRIVER" value="sync"/>
        <env name="MAIL_DRIVER" value="array"/>
    </php>
</phpunit>

I see line :

        <env name="APP_ENV" value="testing"/>

In my project I see 1 root phpunit.xml file and more 80 in /vendor/ subdirectories. Looks like root phpunit.xml is not applied in my tests/Feature/ProfilepageTest.php ? CHow to fix it ?

Activity icon

Replied to Error Testing With User Creation And Triggering Button Click

If in the beginning of the test to insert line

dd(app()->environment());

it shows next :

Runtime:       PHP 7.2.19-0ubuntu0.18.04.2
Configuration: /mnt/_work_sdb8/wwwroot/lar/votes/phpunit.xml
"local"

Is it correct ?

Actually that is TDD test and I missed 1 line in my example. It must be :

        // 6. OPEN PROFILE DETAILS EDITOR PAGE BLOCK START
        $response = $this->actingAs($newUser)
                         ->withSession($newUserSessionData)
                         ->get('profile/edit-details'); 
        $response->assertStatus(HTTP_RESPONSE_OK);
        $response->assertSee(htmlspecialchars("Profile : Details"));

        // 6. OPEN PROFILE DETAILS EDITOR PAGE BLOCK END


        // 6.1 OPEN PROFILE DETAILS EDITOR PAGE AND GENERATE PASSWORD BLOCK START
        $response = $this->actingAs($newUser, 'web')->json('POST', 'profile/generate-password',[ '_token'     => $csrf_token ]);

I opened profile details page and run generate-password functionality next.