Xation

Xation

Lausanne

Member Since 2 Years Ago

Experience Points 14,380
Experience
Level
Lessons Completed 135
Lessons
Completed
Best Reply Awards 0
Best Answer
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

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

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

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

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

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

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

18 Sep
2 months ago

Xation left a reply on Obfuscate Css Class Like Facebook And Google

I found the solution :

 .options({
  vue: {
    cssModules: {
      localIdentName: '[name]-[local]-[hash:base64]',
      camelCase: true
    }
  }
});
16 Sep
2 months ago

Xation started a new conversation Obfuscate Css Class Like Facebook And Google

Someone know how to obfuscate the css class with laravel-mix ? I know that I need to add this options

options: {
        modules: true,
        localIdentName: '[name]-[local]-[hash:base64]'
      }

But because of the merge of the same rule it's not working. And I'm not strong enough with webpack to resole this problem.

Actual webpack.mix.js

 mix.js('resources/js/main.js', 'public/js')
.sass('resources/sass/app.sass', 'public/css');
21 Jan
9 months ago

Xation left a reply on Passport JWT Auth: Setting Larvel_token Via AJAX GET

I try to doing exactly the same thing. Actually I need to reload the page after the ajax login to get the laravel_token.

You find a solution ?

16 Jan
10 months ago

Xation started a new conversation [Redis] Stripe Webhook Almost At The Same Time. I Need To Use Funnel ?

Hello,

I'm using stripe webhook and a lot of time stripe send webhook in a short time difference (18-01-16 19:54:31 and 18-01-16 19:54:28). So sometime the newest webhook is executed ny laravel horizon (redis) before the oldest. So my db is not sync with stripe.

I have to use funnel inside my job ? https://laravel.com/docs/5.5/queues#rate-limiting

Redis::funnel('key')->limit(1)->then(function () {
    // Job logic...
}, function () {
    // Could not obtain lock...

    return $this->release(10);
});

What's for the number 10 inside release() ?

19 Dec
11 months ago

Xation left a reply on Forge, Where Is The "deployment Script" ? [Horizon]

@Robstar Inside App ? No I've nothing because I'm using Envoyer.io. I add the command inside the Deployment Hooks on Envoyer. After the Purge Old Releases.

14 Dec
11 months ago

Xation left a reply on Forge, Where Is The "deployment Script" ? [Horizon]

@kreitje I feel totally stupid. I can not find the button "Deploy Now". It's possible to make some screenshot ?

I'm using Laravel Envoyer. And that's why (maybe) inside https://forge.laravel.com/servers/{server id}/sites/{site id} I've no "apps".

Xation started a new conversation Forge, Where Is The "deployment Script" ? [Horizon]

Hey, i'm following this article https://medium.com/@taylorotwell/deploying-horizon-to-laravel-forge-fc9e01b74d84 for deploying horizon to forge. Tylor say "After you have added the daemon, you only need to add the php artisan horizon:terminate command to the end of your deployment script."

But I don't find where to edit the deployment script inside forge website like the snapshot

28 Aug
1 year ago

Xation left a reply on Getting The Following Error This Dependency Was Not Found: FS

@Procat I've same issue with socket.io when I try to compile. What can I do to install websocket with webpack ?

16 May
1 year ago

Xation left a reply on ES6 Issue With Spark Mixin After Upgrade

@vesper8 Thx, you save my day. Using VueX with the spread like ...mapActions I got the same error.

/js/app.2f5631ff29a5e9c4d550.js from UglifyJs
Unexpected token: punc (() [/js/app.2f5631ff29a5e9c4d550.js:363,8]

I try first to install uglify-es and babel-plugin-transform-object-rest-spread but not working.

Now It's working!

07 May
1 year ago

Xation started a new conversation Laravel Echo Don't Return Notification Created_at Date

Hi,

I use actuelement laravel echo with notification.

Echo.private('App.User.' + window.Laravel.userId).notification((notification) => {
    commit('addNewNotif', data)
})

The problem is that in the data var, I don't get the created_at but only the id, the type and the data. How to add the created_at ?

23 Mar
1 year ago

Xation left a reply on Uncaught ReferenceError: Pusher Is Not Defined

https://github.com/laravel/echo/pull/110

It's normal because a new comit remove the pusher import inside echo

23 Feb
1 year ago

Xation left a reply on File Upload, AWS S3 And Mime-type Issue

@jjanusch this work and save my day. Thanks !

16 Feb
1 year ago

Xation left a reply on Vue Router Remove Class Before Leave And Add Class After Route Loaded

@jurjen There is no possibility to reset the window.load each time the router.afterEach is trigger?

I do not like the idea to initialize view only after the window.load. This will slow down my application (which is a single page application spa

Xation left a reply on Vue Router Remove Class Before Leave And Add Class After Route Loaded

@jurjen yes this add the page-ready but "too fast" the animation is never triggering. With the onload the animation is triggering.

07 Feb
1 year ago

Xation started a new conversation Vue Router Remove Class Before Leave And Add Class After Route Loaded

Hi,

I try to add a class named 'page-ready' when the page/route is loaded. Actually this code above work only once because the load is called once. After, when we navigate trought the vue-router the class is not added again.

The problem is if I don't add the window.load to add the class, the css animation don't work.

 router.beforeEach((to, from, next) => {
    document.documentElement.classList.remove('page-ready')
    next()
 })

 router.afterEach((to, from, next) => {
    $(window).on('load', function() {
        document.documentElement.classList.add('page-ready')
    });
 })

Any sugestion ?

20 Jan
1 year ago

Xation left a reply on How Can I Install Laravel-mix In Laravel 5.3

@Olixr The webpack.mix.js is out of the box.

let mix = require('laravel-mix').mix;

/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Laravel application. By default, we are compiling the Sass
 | file for your application, as well as bundling up your JS files.
 |
 */

mix.js('resources/assets/js/app.js', 'public/js')
   .sass('resources/assets/sass/app.scss', 'public/css');

// Full API
// mix.js(src, output);
// mix.extract(vendorLibs);
// mix.sass(src, output);
// mix.less(src, output);
// mix.combine(files, destination);
// mix.copy(from, to);
// mix.minify(file);
// mix.sourceMaps(); // Enable sourcemaps
// mix.version(); // Enable versioning.
// mix.disableNotifications();
// mix.setPublicPath('path/to/public'); <-- Useful for Node apps.
// mix.webpackConfig({}); <-- Override webpack.config.js, without editing the file directly.

And my bootstrap.js

/**
 * Vendor
 */
import Vue from 'vue';
import VueRouter from 'vue-router';
import axios from 'axios';

window.Vue = Vue;
Vue.use(VueRouter);

window.axios = axios;
window.axios.defaults.headers.common = {
    'X-Requested-With': 'XMLHttpRequest'
 };

 window.$ = window.jQuery = require('jquery'),
 require('jquery-ui'),
 require('jquery-ui/ui/widgets/sortable');
 $.ajaxSetup({
    headers: {
        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
    }
 });

 require('blueimp-file-upload');
 require('cloudinary-jquery-file-upload');
 require('featherlight');
 require('autonumeric');
 require('toastr');
 require('./components/vendor/featherlight.gallery.js');
 require('./components/vendor/jquery.ui.touchpunch.js');
 require('./components/vendor/jquery.payment.js');

/**
 * App
 */
 window.Funcs    = require('./components/funcs.js');
 window.Card     = require('./components/card.js');
 window.User     = require('./components/user.js');
 window.Pay      = require('./components/pay.js');
 window.Form     = require('./components/form.js');
 window.Item     = require('./components/item.js');
 window.Nav      = require('./components/nav.js');
 window.Polyfill = require('./components/polyfill.js');
 window.Modal    = require('./components/modal.js');
 window.Notif    = require('./components/notif.js');

I begin to switch from Jquery to Vuejs.

Xation left a reply on How Can I Install Laravel-mix In Laravel 5.3

Any idea why that move some pics related in my css on the public folder ?

 DONE  Compiled successfully in 18256ms

                                                       Asset       Size  Chunks                    Chunk Names
            card-hearts.png?392dc5c8f6c2ee406110c25e22cd0bcd    40.6 kB          [emitted]
       /fonts/mail-blue.svg?bc84b03ef6f60ad5847ba4f67a80f27f    2.05 kB          [emitted]
       /fonts/bell-blue.svg?8096fbd35076c0a5e7a3adba18025bf4    1.51 kB          [emitted]
      /fonts/bell-white.svg?b25e2fc0083a5f8da82b8e2516d4e3f5    1.51 kB          [emitted]
      /fonts/heart-blue.svg?164988367535dc90f5ca8c6d2c721612  411 bytes          [emitted]
       /fonts/heart-red.svg?1f2a77a142f5f466c1bad0ac79ad5839  411 bytes          [emitted]
     /fonts/heart-white.svg?d32d3516d55ed96b72307328de98a07d  357 bytes          [emitted]
      /fonts/mail-white.svg?5ae85dd9e3f64d77077f16e3d94757b0    1.81 kB          [emitted]
         /fonts/padlock.svg?a84865217e26a16972dc64bbed0b4cdb    1.17 kB          [emitted]
     /fonts/warning-red.svg?05c10db7ec87e81b17d9659d58e9a0d5    1.04 kB          [emitted]
/fonts/abitoi-logo-blue.svg?53c8c0e0b26f0b7afaecb068c40a6b2c    2.95 kB          [emitted]
     /fonts/abitoi-logo.svg?aa5a6277a07b394e8a91cb85b657a494    2.95 kB          [emitted]
               homepage.jpg?2898dbffe90ac50008fc371cb398bf6a     716 kB          [emitted]  [big]
           help_photo_1.jpg?26e962eae7b0d14220f12f358c65c47a    29.3 kB          [emitted]
           help_photo_2.jpg?f106524c7bf8dd1e002be6bb96d7bf88      32 kB          [emitted]
           help_photo_3.jpg?b2ed4560611c45313aa743b9a65b5cae    27.4 kB          [emitted]
           help_photo_4.jpg?7169aa0c8cbc59330f01db5c1c592452    32.1 kB          [emitted]
           help_photo_5.jpg?455a1757d83496140cc8be0af9e72e70    33.7 kB          [emitted]
           help_photo_6.jpg?455a1757d83496140cc8be0af9e72e70    33.7 kB          [emitted]
                                                  \js\app.js    1.13 MB       0  [emitted]  [big]  app
                                                \css\app.css     820 kB       0  [emitted]  [big]  app
                                           mix-manifest.json   74 bytes          [emitted]
19 Jan
1 year ago

Xation started a new conversation Laravel-mix Error Compile Webpack.LoaderOptionsPlugin Is Not A Constructor

Hi !

I follow the vue2 tutorial https://laracasts.com/series/learn-vue-2-step-by-step/episodes/26

I successfully install laravel-mix but when I run node_modules.bin\webpack I have this message error (the file webpack.config.js is out of box)

c:\development\php\laravel\webpack.config.js:252
    new webpack.LoaderOptionsPlugin({
    ^

TypeError: webpack.LoaderOptionsPlugin is not a constructor
    at Object.<anonymous> (c:\development\php\laravel\webpack.config.js:252:5)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at module.exports (c:\development\php\laravel\node_modules\webpack\bin\convert-argv.js:80:13)
    at Object.<anonymous> (c:\development\php\laravel\node_modules\webpack\bin\webpack.js:39:40)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
05 Jan
1 year ago

Xation left a reply on Laravel + Notification + Echo + Pusher = Not Working

I follow the tutorial by mattstauffer and that didn't work... so i investigate and found that I dont put BROADCAST_DRIVER=pusher but BROADCAST_DRIVER=log ..... So it's working now. Sorry for my stupidity

Xation left a reply on Laravel + Notification + Echo + Pusher = Not Working

@ClearanceJobsDev yes of course, pusher and echo work correctly without the private channel.

04 Jan
1 year ago

Xation started a new conversation Laravel + Notification + Echo + Pusher = Not Working

Hi,

I follow the documentation about integrating the notification, echo and pusher. However I have a problem when making the whole working.

I have an error subscription_error in the browser console:

Pusher : State changed : connecting -> connected with new socket ID 122904.8895470
XHR finished loading: POST "http://abitoi.dev/broadcasting/auth".
Pusher : No callbacks on private-App.User.1 for pusher:subscription_error

I can not understand where is the problem. Can you help me ?

Javascript file

/**
 *  Echo - Instantiated
 */
 import Echo from "laravel-echo"
 window.Echo = new Echo({
    broadcaster: 'pusher',
    key: window.Laravel.pusherKey,
    cluster: 'eu',
    encrypted: true
 });

/**
 *  Echo - Listening For Events
 */
 if (typeof window.Laravel.user.id !== 'undefined') {
    window.Echo.private('App.User.' + window.Laravel.user.id)
    .notification((notification) => {
        console.log(notification.type);
    });
 }

The BrodcastServiceProvider.php is out of the box

<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Broadcast;

class BroadcastServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        Broadcast::routes();

        /*
         * Authenticate the user's personal channel...
         */
        Broadcast::channel('App.User.*', function ($user, $userId) {
            return (int) $user->id === (int) $userId;
        });
    }
}
02 Jan
1 year ago

Xation left a reply on Appends In DatabaseNotification Model

@craigpaul Ok. I would like to thank you for your patience and help. They were very precious to me.

Xation left a reply on Appends In DatabaseNotification Model

@craigpaul I understand better now. But is there a better way to do what I want ?

Xation left a reply on Appends In DatabaseNotification Model

@craigpaul It's working with your exemple. Me I use

Auth::user()->notifications

Can you explain me why it's not using the Notification.php model ?

Xation left a reply on Appends In DatabaseNotification Model

And of course if I edit directly DatabaseNotification.php file it's work. But it's really not at all a good idea.

Xation left a reply on Appends In DatabaseNotification Model

@craigpaul Yes I use the php artisan notifications:table command and follow the doc. The notification work correctly in my app (except this).

I remeber run the php artisan notifications:table twice. Can that come from the problem?

    Schema::create('notifications', function (Blueprint $table) {
            $table->uuid('id')->primary();
            $table->string('type');
            $table->morphs('notifiable');
            $table->text('data');
            $table->timestamp('read_at')->nullable();
            $table->timestamps();
        });
DatabaseNotificationCollection {#382 ▼
  #items: array:1 [▼
    0 => DatabaseNotification {#383 ▼
      +incrementing: false
      #table: "notifications"
      #guarded: []
      #casts: array:2 [▶]
      #connection: null
      #primaryKey: "id"
      #keyType: "int"
      #perPage: 15
      +timestamps: true
      #attributes: array:8 [▼
        "id" => "8d742ff2-7a62-40a3-9ce5-02cf81994338"
        "type" => "App\Notifications\WelcomeMessage"
        "notifiable_id" => 1
        "notifiable_type" => "App\User"
        "data" => "{"type":"warning","message":"V\u00e9rifie ton num\u00e9ro de t\u00e9l\u00e9phone pour terminer ton inscription et profiter du site.","link":"http:\/\/test.dev\/phone\/setup"}"
        "read_at" => "2017-01-01 23:01:28"
        "created_at" => "2016-12-29 20:30:00"
        "updated_at" => "2017-01-01 23:01:28"
      ]
      #original: array:8 [▼
        "id" => "8d742ff2-7a62-40a3-9ce5-02cf81994338"
        "type" => "App\Notifications\WelcomeMessage"
        "notifiable_id" => 1
        "notifiable_type" => "App\User"
        "data" => "{"type":"warning","message":"V\u00e9rifie ton num\u00e9ro de t\u00e9l\u00e9phone pour terminer ton inscription et profiter du site.","link":"http:\/\/test.dev\/phone\/setup"}"
        "read_at" => "2017-01-01 23:01:28"
        "created_at" => "2016-12-29 20:30:00"
        "updated_at" => "2017-01-01 23:01:28"
      ]
      #relations: []
      #hidden: []
      #visible: []
      #appends: []
      #fillable: []
      #dates: []
      #dateFormat: null
      #touches: []
      #observables: []
      #with: []
      +exists: true
      +wasRecentlyCreated: false
    }
  ]
}

Xation left a reply on Appends In DatabaseNotification Model

@craigpaul no I don't missing the import (only in my exemple here, I just edit) So it works for you? I do not understand why it does not work it looks so simple. Did I miss something for extending a class ?

Xation started a new conversation Appends In DatabaseNotification Model

Hi,

I can not extend the DatabaseNotification model. It's not working. You can see my Notification.php model :

<?php

namespace App;

class Notification extends DatabaseNotification
{
    protected $appends  = ['test'];

    public function getTestAttribute()
    {
        return 'test';
    }
}

What I need to do ?