ixudra

ixudra

Developer at Ixudra

Kortessem

Hire Me

Member Since 4 Years Ago

Experience Points 14,145
Experience
Level
Lessons Completed 134
Lessons
Completed
Best Reply Awards 2
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.

29 Oct
2 weeks ago

ixudra left a reply on Sync Queue Using Alternate Env Variables

Anyone have an idea?

25 Oct
2 weeks ago

ixudra left a reply on Help With 2fa

Bump :-)

ixudra started a new conversation Sync Queue Using Alternate Env Variables

I'm running a Laravel 5.7 app which uses a queue. On local, this is set to use the sync driver, so events are handled immediately. Works fine, if not for the fact that my events are handled with different environment variables. I know this because set up Slack notifications from the production environment but I receive them every time I run certain queued actions on a local environment. This shouldn't happen since these notifications are disabled on local. I'm sure they don't come from the production server since they all contain test data.

Any idea how this might be?

16 Oct
4 weeks ago

ixudra started a new conversation Help With 2fa

I set up 2fa for my application. Works fine, now I want to add pragmarx/recovery to it but I'm having trouble wrapping my head around how it works. I can generate the codes easily enough and show them on screen and/or save them in the database, but no idea what happens next. Do I need to send them to Google to recover the password? Or are the codes themselves the "password", as it were?

12 Sep
2 months ago

ixudra left a reply on Store Results Of Filter For Back Button

Well, my app doesn't use Vuex and it's not a single page app. Gathering the search results happens using the API, but the results details are a completely new page. So client side isn't going to work, I'm afraid

ixudra started a new conversation Store Results Of Filter For Back Button

Hi

I have a Laravel app with search functionality. I would like to add a "back to search results" functionality, meaning that I want to go back to the original search results (same filters, same page, same page size,...) after viewing one of the results generated by the search. Normally, I would do something like this by adding the search filters to the session and recovering them when going back to the search results.

However, my app is using VueJS as a frontend. This means that the search results are recovered via the API, not a "normal" web request. These API requests use the api middleware group, which means that the session is never initiated, which in turn means that I can't use the session to store the search results.

Is there anyone that has done this before? How did you handle it? Am I missing something?

31 Aug
2 months ago

ixudra left a reply on Two-factor Authentication

So I found the solution... Maybe it's a new addition, but all of the tutorials mention that you need to publish the configuration, but they seem to forget that you need to change the enabled value from false to true. Not sure why that's even in there since you'd think that it's supposed to be enabled if you install the package but oh well.

Hope this helps somebody else in the future.

ixudra left a reply on Two-factor Authentication

@jlrdw Thanks for this, it did help me some but the problem still persists. I've identified the problem but no idea how to fix it. Whenever I log in, I get redirected to the next route, which has the 2fa middleware registered as mentioned in the official docs and the tutorial you provided. For some reason, however, the user is already marked as "authenticated", which means the user is never redirected to the 2FA form.

Am I missing something?

30 Aug
2 months ago

ixudra started a new conversation Two-factor Authentication

Hi

I'm trying to to set up two-factor authentication in my app. I'm using the pragmarx/google2fa package to do so. Setting up 2fa, generating the QR code for the user and saving the secret key t the db works perfectly well. The problems occur when I try to log in. I never get redirected to the one-time password window, even though I added the middleware to the route. I find the tutorials very unclear on this subject. Does anyone have experience with this and would like to help me through it?

ixudra left a reply on Installing Mailhog In VM

Any ideas? Thx

ixudra left a reply on Service Provider Vs Simple Class

Honestly, I only use ServiceProviders if I have a couple of classes that might be able to act as a separate package. Doesn't mean they always have to, in some cases you might only use them in one project. But it's a rule of thumb I use. You can see that in Laravel core too: AuthServiceProvider, RoutingServiceProvider,... All major components that could function individually. For one class, I think there aren't any real advantages

Another way of looking at it, is if you need to initialize stuff. Routing is a good example of this. If you look in the RoutingServiceProvider, you'll see that the routing files are loaded in the boot() method. That to me is also an indication that you're dealing with a module of sorts, rather than just one or to "loose" classes

29 Aug
2 months ago

ixudra started a new conversation Installing Mailhog In VM

I'm running an Ubuntu 16 VM with VMWare, for several of my websites, very happy with my setup. I'd like to add Mailhog to the VM so I can see my emails in the browser instead of sending them to a dummy email address.

I found a tutorial that shows me how to install it. It worked perfectly, the app is running on my VM at port 1025. However, now I would like to access it from my local machine (OSX) in my browser. So far, I haven't been able to manage that.

Anyone ever did something like this before? How can it be done?

Thanks

19 Jul
3 months ago

ixudra left a reply on Sending File Using Guzzle

I feel like slamming my head against my desk for at least 15 mins but my desk is actually pretty expensive... Thanks for your patience and your assist @lostdreamer_nl , this did indeed fix my issue.

ixudra left a reply on Sending File Using Guzzle

This is the request that Postman is sending:

POST /api/whitelabel/images HTTP/1.1
Host: example.com
Accept: application/json
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Authorization: Bearer token-xyz
Cache-Control: no-cache

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="myFile"; filename="plate.jpg"
Content-Type: image/jpeg


------WebKitFormBoundary7MA4YWxkTrZu0gW--

ixudra left a reply on Sending File Using Guzzle

@lostdreamer_nl Got some feedback from that, but not sure what to make of it though:

"""
--ed71df491f8e9775c5c535bc327bfb639a13ce11\r\n
Content-Disposition: form-data; name="myFile"; filename="plate.jpg"\r\n
Content-Length: 78188\r\n
Content-Type: image/jpeg\r\n
\r\n
 Ï Ó\x00\x10JFIF\x00\x01\x01\x01\x01,\x01,\x00\x00 Ý\x00,Photoshop 3.0\x0 .... \r\n
--ed71df491f8e9775c5c535bc327bfb639a13ce11--\r\n
"""

ixudra left a reply on Sending File Using Guzzle

@lostdreamer_nl Tried that as well, didn't work

Sorry, I know you're trying to help but I've been stuck here for a while...

ixudra left a reply on Sending File Using Guzzle

@lostdreamer_nl Tried that, doesn't work

Guzzle version: 6.3.3, which is the latest version

ixudra left a reply on Sending File Using Guzzle

@lostdreamer_nl I get a guzzle client error with a 400 status, saying No image found. For some reason the data is not submitted correctly, or at least the server is not finding it. Not sure how, since I got this code from the official docs

ixudra started a new conversation Sending File Using Guzzle

I'm trying to transform a postman request into Guzzle. Postman works fine, Guzzle is a nightmare. Probably just a minor detail but I can't seem to figure it out. Any help is appreciated.

The postman request: Request

My request so far (not working)

            $response = $this->client->post(
                '/api/whitelabel/images', [
                    'headers' => [
                        'Accept'                => 'application/json',
                        'Content-Type'          => 'multipart/form-data',
                        'Authorization'         => 'Bearer '. $userToken,
                    ],
                    'multipart' => [
                        [
                            'name'     => 'myFile',
                            'contents' => file_get_contents($media->getPath()),
                        ],
                    ],
                ],
            );

Path to file is correct

12 Sep
1 year ago

ixudra left a reply on Two Way Binding Not Successful

@phpMick Yeah, both workoutList and workout props are passed and bound using v-bind, see component files. If I inspect the workouts in the browser, I can clearly see that all props are present in the HTML

ixudra started a new conversation Two Way Binding Not Successful

I'm making an app that allows me to drag and drop elements between lists so I can later store that into a database. I managed to ge this working using the Vue.Draggable library, which is a wrapper around SortableJS.

The problem that I'm having is that only the visual representation is matching. The data does not get updated when I drag an item from one list to another and I have no idea how to make this work. I tried doing some magic using the addToList method, but that didn't do me any good. It seems I can only access the HTML element in there and not the Vue data object it is representing, thus I can not update the data. Am I missing something? Am I not setting it up correctly?

    <div class="row" id="vue-root">
        <div class="col-lg-12">
            <div class="col-lg-4">
                <h2>Required</h2>
                <hiddit-workout-list v-bind="requiredWorkouts"></hiddit-workout-list>

                <h2>Optional</h2>
                <hiddit-workout-list v-bind="optionalWorkouts"></hiddit-workout-list>
            </div>
            <div class="col-lg-8">
                <div class="row col-lg-12">
                    <h1>Workout planning</h1>
                </div>
                <div class="row col-lg-12">
                    <div class="col-lg-4 dropzone">
                        <hiddit-workout-list v-bind="mondayMorningWorkouts"></hiddit-workout-list>
                    </div>
                    <div class="col-lg-4 dropzone">
                        <hiddit-workout-list v-bind="wednesdayMorningWorkouts"></hiddit-workout-list>
                    </div>
                    <div class="col-lg-4 dropzone">
                        <hiddit-workout-list v-bind="fridayMorningWorkouts"></hiddit-workout-list>
                    </div>
                </div>
                <div class="row col-lg-12">
                    <div class="col-lg-4 dropzone">
                        <hiddit-workout-list v-bind="mondayEveningWorkouts"></hiddit-workout-list>
                    </div>
                    <div class="col-lg-4 dropzone">
                        <hiddit-workout-list v-bind="wednesdayEveningWorkouts"></hiddit-workout-list>
                    </div>
                    <div class="col-lg-4 dropzone">
                        <hiddit-workout-list v-bind="fridayEveningWorkouts"></hiddit-workout-list>
                    </div>
                </div>
            </div>
        </div>
    </div>
Vue.component('workout', require('./components/Workout.vue'));
Vue.component('workout-list', require('./components/WorkoutList.vue'));

let vue = new Vue({

    el: '#vue-root',

    data: {

        workouts: [
            {
                id: 1,
                name: 'Cardio 1',
                type: 'cardio',
                optional: false,
                day: 'none',
                timeOfDay: 'none',
                sets: 3,
                reps: 10,
                rest: 24
            },
            {
                id: 2,
                name: 'Cardio 2',
                type: 'cardio',
                optional: true,
                day: 'none',
                timeOfDay: 'none',
                sets: 3,
                reps: 10,
                rest: 24
            },
            {
                id: 3,
                name: 'Agility 1',
                type: 'agility',
                optional: false,
                day: 'none',
                timeOfDay: 'none',
                sets: 3,
                reps: 10,
                rest: 24
            },
            {
                id: 4,
                name: 'Agility 2',
                type: 'agility',
                optional: true,
                day: 'none',
                timeOfDay: 'none',
                sets: 3,
                reps: 10,
                rest: 24
            },
            {
                id: 5,
                name: 'Ropeskipping 1',
                type: 'rope',
                optional: false,
                day: 'none',
                timeOfDay: 'none',
                sets: 3,
                reps: 10,
                rest: 24
            },
            {
                id: 6,
                name: 'Ropeskipping 2',
                type: 'rope',
                optional: true,
                day: 'monday',
                timeOfDay: 'morning',
                sets: 3,
                reps: 10,
                rest: 24
            },
            {
                id: 7,
                name: 'Ropeskipping 3',
                type: 'rope',
                optional: true,
                day: 'monday',
                timeOfDay: 'morning',
                sets: 3,
                reps: 10,
                rest: 24
            },
            {
                id: 8,
                name: 'Ropeskipping 4',
                type: 'rope',
                optional: true,
                day: 'wednesday',
                timeOfDay: 'evening',
                sets: 3,
                reps: 10,
                rest: 24
            }
        ]
    },

    methods: {

    },

    computed: {

        requiredWorkouts() {
            return {
                day: 'none',
                timeOfDay: 'none',
                workouts: this.workouts.filter( workout => !workout.optional && workout.day === 'none' && workout.timeOfDay === 'none' )
            };
        },

        optionalWorkouts() {
            return {
                day: 'none',
                timeOfDay: 'none',
                workouts: this.workouts.filter( workout => workout.optional && workout.day === 'none' && workout.timeOfDay === 'none' )
            };
        },

        mondayMorningWorkouts() {
            return {
                day: 'monday',
                timeOfDay: 'morning',
                workouts: this.workouts.filter( workout => workout.day === 'monday' && workout.timeOfDay === 'morning' )
            };
        },

        mondayEveningWorkouts() {
            return {
                day: 'monday',
                timeOfDay: 'evening',
                workouts: this.workouts.filter( workout => workout.day === 'monday' && workout.timeOfDay === 'evening' )
            };
        },

        wednesdayMorningWorkouts() {
            return {
                day: 'wednesday',
                timeOfDay: 'morning',
                workouts: this.workouts.filter( workout => workout.day === 'wednesday' && workout.timeOfDay === 'morning' )
            };
        },

        wednesdayEveningWorkouts() {
            return {
                day: 'wednesday',
                timeOfDay: 'evening',
                workouts: this.workouts.filter( workout => workout.day === 'wednesday' && workout.timeOfDay === 'evening' )
            };
        },

        fridayMorningWorkouts() {
            return {
                day: 'friday',
                timeOfDay: 'morning',
                workouts: this.workouts.filter( workout => workout.day === 'friday' && workout.timeOfDay === 'morning' )
            };
        },

        fridayEveningWorkouts() {
            return {
                day: 'friday',
                timeOfDay: 'evening',
                workouts: this.workouts.filter( workout => workout.day === 'friday' && workout.timeOfDay === 'evening' )
            };
        }

    }

});
<!-- Workout.vue -->
<template>

    <div class="workout">
        {{ name }}
    </div>

</template>


<script>

    export default {

        props: {
            id: {
                type: Number,
                required: true,
            },
            name: {
                type: String,
                required: true,
            }
        }

    }

</script>
<!-- WorkoutList.vue -->
<template>

    <draggable v-model="workouts" :options="{ group: 'workouts' }" @add="addToList">
        <transition-group class="workout-list">
            <workout v-for="workout in workouts" :key="workout.id" v-bind="workout" class="item"></hiddit-workout>
        </transition-group>
    </draggable>

</template>


<script>

    import draggable from 'vuedraggable'
    import Workout from './Workout.vue'

    export default {

        props: {
            workouts: {
                type: Array,
                required: false
            },
            day: {
                type: String,
                required: true
            },
            timeOfDay: {
                type: String,
                required: true
            }
        },

        components: {
            draggable,
            Workout
        },

        methods: {
            addToList: function(event) {
                // event.item is a HTML element, no connection the the actual data element to be found...
                event.item.day = this.day;
                event.item.timeOfDay = this.timeOfDay;
            }
        }

    }

</script>
05 Sep
1 year ago

ixudra left a reply on How To Test My Package?

@topvillas Mocking the CurlService doesn't solve anything. That class is just an intermediary, only 2 lines of code in there. The real complexity is in the Builder class, that's the one I need to test. And I don't need the CurlService at all to do that

That said, I did consider partial mocking for the Builder class. I could help to get me some coverage at least, but not nearly the level I'm aiming towards

ixudra left a reply on How To Test My Package?

@topvillas That is the general idea, yes, but I have no idea how to accomplish it. cURL is a PHP extension, you can't just mock that. Additionally, the package is platform independent so I don't have a IOC container or facade I can rely on

ixudra started a new conversation How To Test My Package?

I maintain several packages that are available for download via composer. To my shame, most of these do not have tests, despite me using them extensively in my day to day activities. Reason is simple: I don't know how to make them work properly.

For example: my most used package is ixudra/curl, a package for easily sending cURL requests through a fluent query builder. Ideally, I'd want to set up tests that cover all different methods and options, such as GET requests, POST requests, file upload, various header types, ... but I have no idea how to do this. I can't just use random websites, I'll be fixing my tests all the time if they change their interface. I could set up a website myself and provide all the required routes but that just seems silly

How could I best tackle this issue? How can I write reliable tests without external dependencies?

Thx

27 Aug
1 year ago

ixudra left a reply on Laravel Mix Failures - Possible Dependency Issue

It seems NodeJs was the problem here. I recently updated to Node 8.4.* and all my problems disappeared

ixudra started a new conversation How Is JavaScript Set Up In Laravel?

So this is the default app.js file in the Laravel framework:


window._ = require('lodash');

/**
 * We'll load jQuery and the Bootstrap jQuery plugin which provides support
 * for JavaScript based Bootstrap features such as modals and tabs. This
 * code may be modified to fit the specific needs of your application.
 */

try {
    window.$ = window.jQuery = require('jquery');

    require('bootstrap-sass');
} catch (e) {}

/**
 * We'll load the axios HTTP library which allows us to easily issue requests
 * to our Laravel back-end. This library automatically handles sending the
 * CSRF token as a header based on the value of the "XSRF" token cookie.
 */

window.axios = require('axios');

window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

/**
 * Next we will register the CSRF Token as a common header with Axios so that
 * all outgoing HTTP requests automatically have it attached. This is just
 * a simple convenience so we don't have to attach every token manually.
 */

let token = document.head.querySelector('meta[name="csrf-token"]');

if (token) {
    window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
} else {
    console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
}

/**
 * Echo exposes an expressive API for subscribing to channels and listening
 * for events that are broadcast by Laravel. Echo and event broadcasting
 * allows your team to easily build robust real-time web applications.
 */

// import Echo from 'laravel-echo'

// window.Pusher = require('pusher-js');

// window.Echo = new Echo({
//     broadcaster: 'pusher',
//     key: 'your-pusher-key'
// });

I understand what is going on here - we use requirejs to load in lodash, jQuery, bootstrap, axios and possibly pusher as the file is loaded in. Thing is, I don't understand how this is happening. I looked at the requirejs documentation and it seems completely different from what I'm seeing here. How does the app know to look for ~/node-modules/jquery/dist/jquery.js, only from the string 'jquery'? There doesn't seem to be any pattern as far as I can see, so how is that set up?

Let's say I have a small js file from a friend of mine, how could I include it? Right now, I merge them using the mix file, but it seems like there should be a more elegant way of doing this... ?

06 Jul
1 year ago

ixudra left a reply on Supervisor Not Found

Honestly I don't really remember because it's been such a long time but if I had to guess:

[[email protected]]# supervisorctl
unix:///tmp/supervisor.sock refused connection
supervisor> status
unix:///tmp/supervisor.sock refused connection
supervisor> reread
error: <class 'socket.error'>, [Errno 111] Connection refused: file: /usr/lib64/python2.7/socket.py line: 224
supervisor> exit

basically means that the service was not started correctly before accessing the control panel. So what you need to do to fix that, is (surprise surprise) start supervisor:

sudo service supervisor restart

After that, you should be able to access the control panel without issue

04 Jul
1 year ago

ixudra left a reply on Laravel Mix Failures - Possible Dependency Issue

@kehator To be honest: I'm about 98.749% sure the path problem will resolve itself as soon as I manage to update my Laravel mix to > 0.8, it's a know bug that @JeffreyWay actually added a fix for (see Github link in original post). I just have no idea what is going wrong here

ixudra left a reply on Laravel Mix Failures - Possible Dependency Issue

@kehator I believe you misread: I am NOT using a custom webpack config file.

02 Jul
1 year ago

ixudra started a new conversation Laravel Mix Failures - Possible Dependency Issue

I'm trying to manage my dependencies using Laravel Mix. Installing my dependencies works fine, however running npm run dev brings me to a world of trouble.

Here is my package.json file:

{
  "private": true,
  "scripts": {
    "dev": "npm run development",
    "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch-poll": "npm run watch -- --watch-poll",
    "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
    "prod": "npm run production",
    "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
  },
  "devDependencies": {
    "axios": "^0.16.2",
    "bootstrap-sass": "^3.3.7",
    "cross-env": "^5.0.1",
    "eonasdan-bootstrap-datetimepicker": "^4.17.0",
    "modernizr": "^3.3.1",
    "restfulizerjs": "^1.0.0",
    "jquery": "^3.1.1",
    "laravel-mix": "^1.0",
    "lodash": "^4.17.4",
    "vue": "^2.1.10"
  }
}

Here is my Laravel mix file:

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

var paths = {
    'bootstrap':        './node_modules/bootstrap-sass/assets/',
    'dateTimePicker':   './node_modules/eonasdan-bootstrap-datetimepicker/src/',
    'jquery':           './node_modules/jquery/',
    'modernizr':        './node_modules/modernizr/',
    'moment':           './node_modules/moment/',
    'momentTimezone':   './node_modules/moment-timezone/',
    'restfulizer':      './node_modules/restfulizerjs/'
};

mix

// Compile SASS files
    .sass('resources/assets/bootstrap/sass/app.scss', 'public/bootstrap/css/app.css')

    // Copy fonts to public directory
    .copy(paths.bootstrap + 'fonts/bootstrap/**', 'public/bootstrap/fonts')

    // Combine Javascript files
    .js([
        paths.jquery + "dist/jquery.js",
        paths.bootstrap + "javascripts/bootstrap.js",
        paths.moment + "moment.js",
        paths.dateTimePicker + "js/bootstrap-datetimepicker.js",
        paths.restfulizer + "jquery.restfulizer.js",
        "resources/assets/bootstrap/js/app.js"
    ], 'public/bootstrap/js/app.js', './')

    // Version stylesheet and javascript file
    .version();

The error that I get is the following:

$ npm run dev

> @ dev /var/www/my-hiddit/htdocs
> npm run development


> @ development /var/www/my-hiddit/htdocs
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.output.path: The provided value "public" is not an absolute path!

That brought me to these posts on the Laravel Mix github page. At first, it didn't seem to apply to me because I have Laravel mix at ^1.0 in my package.json file. But then I ran a node list --depth=0 and got the following:

$ npm list --depth=0
/var/www/my-hiddit/htdocs
├── [email protected] invalid
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] invalid
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

I've tried to fix this in any number of ways, but no matter what I do Laravel Mix always stays stuck at 0.7.5 - even if I fix the version or if I remove all other dependencies from the file. I assume this is what's causing my other problem but I have absolutely no idea why this is happening or how I can fix it.

Any help would be appreciated.

OS: Ubuntu 16 Ruby version: 2.3.1 Node version: 8.0.7 NPM version: 5.0.3

12 Apr
1 year ago
06 Apr
1 year ago

ixudra started a new conversation Non-searchable Arguments Not Returned By Algolia

I have a small app where I use algolia. Amongst other things, I store a profile image in Algolia. These image urls and alts should not be searchable so I exclude them in the algolia rankings screen. This works fine, except for the fact that these fields are now no longer returned in the search results. This is no good and absolutely makes no sense to me.

Is this normal behavior or am I doing something wrong?

14 Feb
1 year ago

ixudra left a reply on Composer Dependency Issues

@KamalKhan That did indeed solve this issue, but it wasn't what I was looking for. I was hoping to set up an app where I could test all my own packages on dev-master, but I guess that's not possible if they depend on each other.

Thanks everyone for the help

10 Feb
1 year ago

ixudra left a reply on Composer Dependency Issues

@KamalKhan That was one of the first things I tried, same error.

ixudra started a new conversation Composer Dependency Issues

I'm having some issues with downloading a couple of packages via composer. As far as I can see, there should not be a problem. Sadly, I keep getting an error saying that there is a mismatch in the dependencies.

Composer.json file for the application:

{
    "name": "Project",
    "require": {
        "php": ">=5.6.4",
        "laravel/framework": "5.3.*",
        "laravelcollective/html": "~5.3",
        "laracasts/presenter": "0.2.*",
        "arcanedev/log-viewer": "^4.0",
        "ixudra/translation": "dev-master",
        "ixudra/portfolio": "dev-master",
        "ixudra/validation": "dev-master",
        "ixudra/core": "dev-master",
        "ixudra/csi": "dev-master"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "scripts": {
        "post-install-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "pre-update-cmd": [
            "php artisan clear-compiled"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan optimize",
            "php artisan ide-helper:generate"
        ]
    }
}

Composer.json for package 1:

{
    "name": "ixudra/portfolio",
    "version": "0.2.0",
    "require": {
        "php": ">=5.4.0",
        "illuminate/support": "~5.0",
        "laravelcollective/html": "~5.0",
        "ixudra/core": "~5.0",
        "ixudra/translation": "~5.1",
        "ixudra/imageable": "~6.0",
        "laracasts/presenter": "0.2.*"
    },
    "autoload": {
        "classmap": [
            "src/database/migrations"
        ],
        "psr-4": {
            "Ixudra\\Portfolio\\": "src/"
        }
    }
}

Composer.json for package 2:

{
    "name": "ixudra/core",
    "version": "5.3",
    "require": {
        "php": ">=5.4.0",
        "illuminate/support": "~5.0",
        "laracasts/presenter": "0.2.*"
    },
    "autoload": {
        "classmap": [
            "src/migrations"
        ],
        "psr-4": {
            "Ixudra\\Core\\": "src/"
        }
    }
}

This is the error I receive:

$ composer update --no-scripts
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for ixudra/portfolio dev-master -> satisfiable by ixudra/portfolio[dev-master].
    - ixudra/portfolio dev-master requires ixudra/translation ~5.1 -> satisfiable by ixudra/translation[5.1.0, 5.1.1, 5.1.2, 5.1.3, 5.1.4, 5.1.5, 5.2.0, 5.2.1] but these conflict with your requirements or minimum-stability.

As far as I can see, the ixudra/translation dependency should be resolved by [dev-master]. I don't understand why this is not the case. If I remove the ixudra/portfolio package from the app, the dev-master version of ixudra/translation is downloaded without a problem... Can someone please understand what I am doing wrong here?

30 Nov
1 year ago

ixudra left a reply on Catching Errors In CURL Requests

@jekinney Try-catch will not work as controller and cURL request are in two different applications. My question is related to recovering the error message in the second application, where no actual exception is thrown. Also your condescending tone is noted but not appreciated

@ejdelmonico As you can see from my example, using curl_error($e); returns a generic error message instead of the `You shall not pass that I expect. Maybe there is something wrong with my cURL request, but in all my experiments, I have never been able to make this work.

29 Nov
1 year ago

ixudra started a new conversation Catching Errors In CURL Requests

Question about cURL: say I have the following code

class MyController {

    public function index()
    {
        throw new \InvalidArgumentException('You shall not pass!!');
    }
}

Now let's say that I want to call this piece of code via cURL:

// Create a curl handle to a non-existing location
$ch = curl_init('http://someUrl.net/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

if(curl_exec($ch) === false)
{
    echo curl_error($ch);
}

// Close handle
curl_close($ch);

The code itself works fine, only I don't see my custom exception message. All I see is error code 500 and the following error message:

The requested URL returned error: 500 Internal Server Error

This message is not very helpful as I want to see what exactly went wrong. Is there a way to do this?

27 Nov
1 year ago

ixudra left a reply on Error When Upgrading To Laravel 5.3

Found the problem. Our current installation of newRelic is incompatible with Laravel 5.2-5.3, which is causing the issue. Took me a while to find it because the stack trace doesn't actually show the full class name, but found it through dd(). Solution is to upgrade your newRelic to a more recent version:

https://discuss.newrelic.com/t/php-agent-breaks-laravel-5-2/32801/31

25 Nov
1 year ago

ixudra left a reply on Error When Upgrading To Laravel 5.3

@freekmurze The bootstrap/compiled.php file has been removed so that is also not causing the problem..

24 Nov
1 year ago

ixudra left a reply on Error When Upgrading To Laravel 5.3

@Tirke Yes, I have the routes directory in my root with web, api and console files. The original routes.php has been deleted

@ejdelmonico All arguments from the boot methods in all ServiceProviders have been removed

Like I said: locally I have no issues, the site runs perfectly in 5.3. It all goes wrong as soon as I deploy to our staging server

23 Nov
1 year ago

ixudra started a new conversation Error When Upgrading To Laravel 5.3

I upgraded my app to Laravel 5.3 from 5.2, no errors locally. But when I deploy to the server, the following error occurs:

BadMethodCallException in Macroable.php line 74: Method after does not exist.

    in Macroable.php line 74
    at Router->__call('after', array(object(AfterFilter))) in BootProviders.php line 17
    at Router->after(object(AfterFilter)) in BootProviders.php line 17
    at Application->boot() in BootProviders.php line 17
    at BootProviders->bootstrap(object(Application)) in Application.php line 203
    at Application->bootstrapWith(array('Illuminate\Foundation\Bootstrap\DetectEnvironment', 'Illuminate\Foundation\Bootstrap\LoadConfiguration', 'Illuminate\Foundation\Bootstrap\ConfigureLogging', 'Illuminate\Foundation\Bootstrap\HandleExceptions', 'Illuminate\Foundation\Bootstrap\RegisterFacades', 'Illuminate\Foundation\Bootstrap\RegisterProviders', 'Illuminate\Foundation\Bootstrap\BootProviders')) in Kernel.php line 254
    at Kernel->bootstrap() in Kernel.php line 145
    at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 117
    at Kernel->handle(object(Request)) in index.php line 57

I have no clue where this is coming from or even where to begin looking for the solution. I tried reverting back to 5.2 and removing all cached files (routes, config,...) but that didn't do anything. Any suggestions are welcome

03 May
2 years ago

ixudra started a new conversation Laravel Queries

I was wondering exactly how queries are handled in Laravel. for a while now, we are experiencing some issues on our database server. At some times, for no apparent reason, our app can no longer connect to the database and collect information from it:

[2016-04-15 12:17:39] production.ERROR: exception 'PDOException' with message 'SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'db-001.server.com' (99 "Cannot assign requested address")' in /path/to/app/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:55

This happens on random times, even in the middle of the night when nobody is actually using the app. The issue always resolves itself after a minute or two, but it's a huge problem if you are actually working on something important at that particular moment.

I've contacted the hosting support and they expect it to be some kind of pooling issue, saying that laravel is making too many database connections and not closing them properly. Hence my question: how does this work in Laravel? Is every query a new connection or is this handled more gracefully (per transaction,...)?

24 Apr
2 years ago

ixudra left a reply on Where Can I Get A Step By Step Guide On Installing Packages In Laravel

@AndrewBen Did you manage to resolve the issue you were having?

ixudra left a reply on Sending Emails With Mailgun

Sadly, no.. The domain needs to be verified before you can send emails... And the domain will not be verified until the DNS changes have been propagated :-(

ixudra left a reply on Sending Emails With Mailgun

Well, I have to add two TXT but also one CNAME for the link tracking, so I guess I just have to wait it out either way..

ixudra left a reply on Sending Emails With Mailgun

From mailgun.com:

Once you've added the appropriate DNS records for verification, it can take 24-48 hours for them to propagate.

I'm not making this stuff up...

ixudra left a reply on Sending Emails With Mailgun

Well I did add the domain, but it takes 24-48h for it to verify... As a matter of fact, my domain just verified and I was able to send emails after that.

So how and when would I use the sandbox? I'm still trying to make sense of this..

ixudra started a new conversation Sending Emails With Mailgun

I'm trying to use Mailgun to send emails to my users in my app. Unfortunately, I can't get this to work. I added a custom domain and I'm waiting for that to resolve. In the meantime, I'd like to continue working on my app on my development machine. I can't get this to work and it's getting really frustrating.

First, I tried sending it using the mailgun driver:

MAIL_DRIVER=mailgun
MAILGUN_DOMAIN=sandbox-------------------.mailgun.org
MAILGUN_SECRET=key-----------------------

Unfortunately, I get the following error:

Client error: `POST https://api.mailgun.net/v3/sandbox-----------------------.mailgun.org/messages.mime` resulted in a `400 BAD REQUEST` response: { "message": "Sandbox subdomains are for test purposes only. Please add your own domain or add the address to authoriz (truncated...)

So instead, I tried using smtp:

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=25
MAIL_USERNAME=postmaster@sandbox------------------------.mailgun.org
MAIL_PASSWORD=somePassword
MAIL_ENCRYPTION=null

which also thrown an exception:

Expected response code 250 but got code "554", with message "554 Sandbox subdomains are for test purposes only. Please add your own domain or add the address to authorized recipients in domain settings. " 

Which begs the question: what are these sandbox domains for? How can and should they be used? I'm at a loss here..

And how are you supposed to send emails in a development setting using Mailgun?

25 Mar
2 years ago

ixudra left a reply on Supervisor Not Found

@ohffs The first command doesn't yield any output at all, but that doesn't surprise me. I knew from the start that the setup wasn't perfect. As an example: the supervisor.conffile is not stored in /etc/supervisor, as you would think, but instead can be found in the /etc directory itself. Additionally, the queues themselves are defined inside the config file instead of using a directory with additional files, as is common.