dubbeltje

dubbeltje

Member Since 4 Years Ago

Experience Points
17,115
Total
Experience

2,885 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
235
Lessons
Completed
Best Reply Awards
4
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 4
17,115 XP
03 Sep
2 weeks ago

dubbeltje started a new conversation Use Vue CLI In A Laravel Project

Hello,

I am trying to change my existing Laravel (5.8) project with a Vue frontend to work like a PWA. I am following a tutorial like: https://naturaily.com/blog/pwa-vue-cli-3. It recommends to run some vue cli commands like vue add @vue/pwa. However vue-cli is not installed in Laravel projects. Should I go on and install vue-cli or will I then ruin the L Laravel setup. Or should I do it in another way?

Thanks.

09 Jul
2 months ago

dubbeltje left a reply on Failed Asserting That Exception Of Type "\Exception" Is Thrown.

@siangboon the last part of the uri is a parameter. The code in the function looks like this:

<?php

namespace App\Http\Controllers;

use Exception;

class EnumsController extends Controller
{
    public function show($enum)
    {


        $classname = 'App\Enums\' . ucfirst($enum);
        if (!class_exists($classname)) {
            throw new Exception('sfd');
        }
        return response()->json($classname::values(), 200);
    }
}

The route file looks like this:

Route::get('/enums/{enum}', '[email protected]');

Even when properly importing \Exception I get the same error:

Failed asserting that exception of type "Exception" is thrown.

This is the test I am trying to run.

   /**
     * @test
     */
    public function an_exception_will_be_thrown_if_unknown_enum_is_requested()
    {
        $this->expectException(Exception::class);
        $this->get('/api/enums/nonexistingenum');

    }
08 Jul
2 months ago

dubbeltje left a reply on Failed Asserting That Exception Of Type "\Exception" Is Thrown.

Correct. But it still throws the same error: 'Failed asserting that exception of type "Exception" is thrown.'

dubbeltje left a reply on Failed Asserting That Exception Of Type "\Exception" Is Thrown.

@bobbybouwmann

When I do this:

/**
     * @test
     */
    public function an_exception_will_be_thrown_if_unknown_enum_is_requested()
    {
        $this->expectException(\Exeption::class);
        $this->getJson('/api/enums/nonexistingenum');

    }


public function show($enum)
 {
       throw new \Exception('sfdsfd');
     
 }

I get the response:

Failed asserting that exception of type "Exeption" is thrown.

dubbeltje left a reply on Failed Asserting That Exception Of Type "\Exception" Is Thrown.

Illuminate\Foundation\Testing\TestResponse {#328
  +baseResponse: Illuminate\Http\Response {#398
    +headers: Symfony\Component\HttpFoundation\ResponseHeaderBag {#403
      #computedCacheControl: array:2 [
        "no-cache" => true
        "private" => true
      ]
      #cookies: []
      #headerNames: array:5 [
        "cache-control" => "Cache-Control"
        "date" => "Date"
        "content-type" => "Content-Type"
        "x-ratelimit-limit" => "X-RateLimit-Limit"
        "x-ratelimit-remaining" => "X-RateLimit-Remaining"
      ]
      #headers: array:5 [
        "cache-control" => array:1 [
          0 => "no-cache, private"
        ]
        "date" => array:1 [
          0 => "Mon, 08 Jul 2019 19:40:51 GMT"
        ]
(...)

dubbeltje left a reply on Failed Asserting That Exception Of Type "\Exception" Is Thrown.

It does hit the endpoint because I have got already one test which hits the endpoint and gives good results. It's just the one with the exception which I can't get working.

dubbeltje left a reply on Failed Asserting That Exception Of Type "\Exception" Is Thrown.

If I do a dd of $this->getJson('/api/enums/nonexistingenum') then I get:

Illuminate\Foundation\Testing\TestResponse {#347
  +baseResponse: Illuminate\Http\JsonResponse {#419
    #data: """
      {\n
          "message": "sfdsfd",\n
          "exception": "Exception",\n
          "file": "/home/vagrant/code/kasjroet/app/Http/Controllers/EnumsController.php",\n
...

dubbeltje left a reply on Failed Asserting That Exception Of Type "\Exception" Is Thrown.

@mstrauss sharp one however this wasn't the issue. I fixed the start post. Still getting the same error

dubbeltje started a new conversation Failed Asserting That Exception Of Type "\Exception" Is Thrown.

Hi,

I am running Laravel 5.8.27 and phpunit 7.5.13.

I have this test:

  /**
     * @test
     * @expectedException \Exception
     */
    public function an_exception_will_be_thrown_if_unknown_enum_is_requested()
    {
        $this->withExceptionHandling();
        $this->getJson('/api/enums/nonexistingenum');


    }

In my controller function I throw the exception right away:

public function show($enum)

    { 
   throw new \Exception('sfdsfd');
 }

However I get this error when running the test:

Failed asserting that exception of type "\Exception" is thrown.

Any suggestions?

27 May
3 months ago

dubbeltje started a new conversation Injecting Bugsnag In Queuefailed

Hello,

I am trying to inject Bugsnag to Queue::failing in my AppServiceProvider as follows:

public function boot() {

Queue::failing(function (JobFailed $event, Bugsnag $bugsnag) {

            $payload = $event->job->payload();
            $jobName = $payload['displayName'];
            $bugsnag->notifyException($event->getException());

            
        });

}

This gives me the following Error:

2019-05-26 20:59:41] local.ERROR: Too few arguments to function ProjectScraper\Providers\AppServiceProvider::ProjectScraper\Providers\{closure}(), 1 passed in /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php on line 347 and exactly 2 expected {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Too few arguments to function ProjectScraper\Providers\AppServiceProvider::ProjectScraper\Providers\{closure}(), 1 passed in /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php on line 347 and exactly 2 expected at /home/vagrant/code/project/scraper/app/Providers/AppServiceProvider.php:38)
[stacktrace]
#0 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(347): ProjectScraper\Providers\AppServiceProvider->ProjectScraper\Providers\{closure}(Object(Illuminate\Queue\Events\JobFailed))
#1 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(196): Illuminate\Events\Dispatcher->Illuminate\Events\{closure}('Illuminate\\Queu...', Array)
#2 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(185): Illuminate\Events\Dispatcher->dispatch('Illuminate\\Queu...')
#3 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Queue/InteractsWithQueue.php(47): Illuminate\Queue\Jobs\Job->fail(Object(Exception))
#4 /home/vagrant/code/project/scraper/app/Jobs/Traits/UsesProxyCrawl.php(39): ProjectScraper\Jobs\FooScrapeJob->fail(Object(Exception))
#5 [internal function]: ProjectScraper\Jobs\FooScrapeJob->handle()
#6 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): call_user_func_array(Array, Array)
#7 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#8 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#9 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Container/Container.php(576): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#10 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(94): Illuminate\Container\Container->call(Array)
#11 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}(Object(ProjectScraper\Jobs\FooScrapeJob))
#12 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(ProjectScraper\Jobs\FooScrapeJob))
#13 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(98): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#14 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(49): Illuminate\Bus\Dispatcher->dispatchNow(Object(ProjectScraper\Jobs\FooScrapeJob), false)
#15 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(88): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\RedisJob), Array)
#16 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(327): Illuminate\Queue\Jobs\Job->fire()
#17 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(277): Illuminate\Queue\Worker->process('redis', Object(Illuminate\Queue\Jobs\RedisJob), Object(Illuminate\Queue\WorkerOptions))
#18 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(118): Illuminate\Queue\Worker->runJob(Object(Illuminate\Queue\Jobs\RedisJob), 'redis', Object(Illuminate\Queue\WorkerOptions))
#19 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(102): Illuminate\Queue\Worker->daemon('redis', 'default', Object(Illuminate\Queue\WorkerOptions))
#20 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(86): Illuminate\Queue\Console\WorkCommand->runWorker('redis', 'default')
#21 [internal function]: Illuminate\Queue\Console\WorkCommand->handle()
#22 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): call_user_func_array(Array, Array)
#23 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#24 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#25 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Container/Container.php(576): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#26 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Console/Command.php(183): Illuminate\Container\Container->call(Array)
#27 /home/vagrant/code/project/scraper/vendor/symfony/console/Command/Command.php(255): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#28 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Console/Command.php(170): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#29 /home/vagrant/code/project/scraper/vendor/symfony/console/Application.php(908): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#30 /home/vagrant/code/project/scraper/vendor/symfony/console/Application.php(269): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#31 /home/vagrant/code/project/scraper/vendor/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#32 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Console/Application.php(90): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#33 /home/vagrant/code/project/scraper/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(133): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#34 /home/vagrant/code/project/scraper/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#35 {main}
"}

How could I fix this?

09 Apr
5 months ago

dubbeltje left a reply on Required_if In Array Structure

I have tried to write a custom validator:

$validator->sometimes('persons.*.birthdate', 'required', function($input){

  //How would the closure know to which item of the array the birthdate_private is referring?

  return $input->birthdate_private;
})

$input->persons.*.birthdate won't work.

08 Apr
5 months ago

dubbeltje started a new conversation Required_if In Array Structure

persons.*.birthdate=> [
    required_if:persons.*.birthdate_private,false
];

Here I have a validation rule whch says that a birthdate needs to be entered only if the birthdate is not private.

So now I have a form with 2 persons. For one the brithdate is not private and I entered the birth date. For the second one the birthdate is private and didn't enter the birthdate.

Now this validation rule still fails and gives a 422 error

How Can I properly create this rule?

14 Mar
6 months ago

dubbeltje left a reply on Getting My Posts To Show The Correct Amount

Can you show me your current code of the controller?

dubbeltje left a reply on How To Post Data To Laravel Using Ajax

@GATHUKU - What is the value of select before you send it in the post request?

dubbeltje left a reply on Getting My Posts To Show The Correct Amount

Does your code get into the if statement or not?

dubbeltje left a reply on Carbon SetTestNow() Is Not Working On Server

This seems correct new Carbon('Wednesday'); is not the correct way to set a date see: https://carbon.nesbot.com/docs/

dubbeltje left a reply on Getting My Posts To Show The Correct Amount

So then it should be if (Input::get('some-posts) === 'three-months')

dubbeltje left a reply on Getting My Posts To Show The Correct Amount

Can you do dd($request)->all() ?

dubbeltje left a reply on Datatables Search Field On Related Models

Hey @penaf,

You Should consider to rephrase your question. This will help you in understanding your actual problem. And I don't say this to be mean. But properly phrasing your question will help you (and others also) in understanding the actual problem.

Good luck.

dubbeltje left a reply on Getting My Posts To Show The Correct Amount

What does this do? if($request->all() == 'three_months')

It doesn't seem right to me.

dubbeltje left a reply on How To Post Data To Laravel Using Ajax

Hi,

It seems your selected variable is empty. You should be able to post your form like this: var data = $('#myForm').serializeArray();

13 Jan
8 months ago

dubbeltje left a reply on Laravel Forge Pushing To Master Gives An Error

Actually I did. I did a git stash on my server and then I could deploy it.

So then when should I run npm production in order to prevent this happening again?

dubbeltje started a new conversation Laravel Forge Pushing To Master Gives An Error

Hello Everyone,

I am trying to push my master branch which will trigger forge to deploy. However Forge gives me this error:

Sun Jan 13 20:42:18 UTC 2019
From bitbucket.org:xxxxxxxx/yyyyy
 * branch            master     -> FETCH_HEAD
   7e32660..310a40a  master     -> origin/master
error: Your local changes to the following files would be overwritten by merge:
    public/js/app.js
    public/mix-manifest.json
Please, commit your changes or stash them before you can merge.
Aborting
Updating f7ea17b..310a40a

Now I don't have anything special in my build script:

cd /home/forge/xxxxxxx.nl
git pull origin master
composer install --no-interaction --prefer-dist --optimize-autoloader
echo "" | sudo -S service php7.1-fpm reload

if [ -f artisan ]
then
    php artisan migrate --force
fi

So I am not sure how I should solve this. If i do git status on my master branche i get that there are no changes. So what should i do now?

06 Jan
8 months ago

dubbeltje left a reply on EventDispatcher Injection Not Working

@ADAMPRICKETT - I thought about trying this, and I didn't. But yes this works.

Thanks!

dubbeltje started a new conversation EventDispatcher Injection Not Working

Hi Everyone,

When Firing an event like so event(new NewNotificationCreated($notification)); the event is dispatched and broadcast. However when Inject the dispatcher it like so:


use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
 
public function __construct(EventDispatcher $event)
{

     $this->event = $event;
}

public function show($id)
{
     $this->event->dispatch(NewNotificationCreated::class, [$notification]);
}

In this case the event does not broadcast.

I checked vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:255 But there I see the payload is not an instance of Should broadcast and therefore it doesn't broadcast.

What am I doing wrong here?

06 Dec
9 months ago

dubbeltje left a reply on Unresolvable Dependency

@REALRANDYALLEN - Have tried it. But got the same error.

dubbeltje started a new conversation Unresolvable Dependency

Hello,

I am getting this error in my website:

 Unresolvable dependency resolving [Parameter #0 [ <required> $api_key ]] in class DrewM\MailChimp\MailChimp

I installed this package spatie/laravel-newsletter and created the config/newsletter.php file. I also have in my .env file a MAILCHIMP_APIKEY defined. I cleared my config cache a few times but still get this error. How can I debug / solve this error?

Thanks

dubbeltje left a reply on Issue With Creating My First Package

Doesn't work. Please read my previous reply. I updated it.

dubbeltje left a reply on Issue With Creating My First Package

@MUNAZZIL - It doesn't work. Tried it.

The spatie package is installed in the vendor folder in package but not in the vendor folder of the whole project. I guess it has something to do with this.

dubbeltje left a reply on Issue With Creating My First Package

@munazzil I use this:

use Spatie\Newsletter\Newsletter;

dubbeltje left a reply on Issue With Creating My First Package

@munazzil Hi,

I tried this, but still get this error:

Class 'Spatie\Newsletter\NewsletterServiceProvider' not found

dubbeltje started a new conversation Issue With Creating My First Package

Hello Everyone,

I am following this tutorial to create my first package. https://wisdmlabs.com/blog/create-package-laravel So in my Laravel project I have a package directory where my Package lives.

Now when I do a composer update in the root of my project, I get this error:

Class Spatie\Newsletter\Newsletter does not exist

But in the composer.json I have this:

"require": {
    "spatie/laravel-newsletter": "^4.2"
  },

Any suggestions?

03 Jun
1 year ago

dubbeltje started a new conversation Csp Eval Error

I am developing a site, which is still local. I installed this package to add the correct CSP to my site (which I built with Laravel & VueJs).

I have solved them one by one. But now in my chrome console, I don't see any CSP errors anymore. It only shows a blank page. I opened the site in Firefox. There, in the console, I came across the following error:

Content Security Policy: The page’s settings blocked the loading of a resource at self (“script-src”). Source: call to eval() or related function blocked by CSP.

I searched the generated bundles for the eval() function, but it doesn't appear in any of the files. Does anyone here have some suggestions for me on how to solve this?

dubbeltje left a reply on Npm Run Production Fails.

@topvillas thanks for your prompt. I thought that I already upgraded NPM and Node. But now I am getting this new error:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'production' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'preproduction', 'production', 'postproduction' ]
5 info lifecycle @~preproduction: @
6 info lifecycle @~production: @
7 verbose lifecycle @~production: unsafe-perm in lifecycle true
8 verbose lifecycle @~production: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Volumes/DEV-DRIVE/hypotheekbond/test/jigal/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/jigal.sanders/Library/Android/sdk/tools:/Users/jigal.sanders/Library/Android/sdk/platform-tools
9 verbose lifecycle @~production: CWD: /Volumes/DEV-DRIVE/hypotheekbond/test/jigal
10 silly lifecycle @~production: Args: [ '-c',
10 silly lifecycle   'cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js' ]
11 silly lifecycle @~production: Returned: code: 1  signal: null
12 info lifecycle @~production: Failed to exec production script
13 verbose stack Error: @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:304:16)
13 verbose stack     at EventEmitter.emit (events.js:182:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:182:13)
13 verbose stack     at maybeClose (internal/child_process.js:961:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
14 verbose pkgid @
15 verbose cwd /Volumes/DEV-DRIVE/hypotheekbond/test/jigal
16 verbose Darwin 17.5.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "production"
18 verbose node v10.3.0
19 verbose npm  v6.1.0
20 error code ELIFECYCLE
21 error errno 1
22 error @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
22 error Exit status 1
23 error Failed at the @ production script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Just not sure how to handle this. I guess it has to do with something wrong in my package.json but can't figure out what.

dubbeltje started a new conversation Npm Run Production Fails.

Hi,

I am having this config in my package.json

{
  "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 --display-error-details --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": {
    "laravel-mix": "^2.0",
    "less": "^3.0.2",
    "less-loader": "^4.1.0",
    "lodash": "^4.17.4",
    "popper.js": "^1.12",
    "tailwindcss": "^0.5.2",
    "vue": "^2.5.7",
    "yarn": "*"
  },
  "dependencies": {
    "tinymce": "^4.6.4",
    "axios": "^0.18",
    "cross-env": "^5.1"
  }
}

However, when I run: npm i -- production and npm run production I get the following error:

0 info it worked if it ends with ok
1 warn npm npm does not support Node.js v7.5.0
2 warn npm You should probably upgrade to a newer version of node as we
3 warn npm can't make any promises that npm will work with this version.
4 warn npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11.
5 warn npm You can find the latest version at https://nodejs.org/
6 verbose cli [ '/usr/local/Cellar/node/7.5.0/bin/node',
6 verbose cli   '/usr/local/bin/npm',
6 verbose cli   'run',
6 verbose cli   'production' ]
7 info using [email protected]
8 info using [email protected]
9 verbose run-script [ 'preproduction', 'production', 'postproduction' ]
10 info lifecycle @~preproduction: @
11 info lifecycle @~production: @
12 verbose lifecycle @~production: unsafe-perm in lifecycle true
13 verbose lifecycle @~production: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Volumes/DEV-DRIVE/hypotheekbond/test/jigal/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/jigal.sanders/Library/Android/sdk/tools:/Users/jigal.sanders/Library/Android/sdk/platform-tools
14 verbose lifecycle @~production: CWD: /Volumes/DEV-DRIVE/hypotheekbond/test/jigal
15 silly lifecycle @~production: Args: [ '-c',
15 silly lifecycle   'cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js' ]
16 silly lifecycle @~production: Returned: code: 1  signal: null
17 info lifecycle @~production: Failed to exec production script
18 verbose stack Error: @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
18 verbose stack Exit status 1
18 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:304:16)
18 verbose stack     at emitTwo (events.js:106:13)
18 verbose stack     at EventEmitter.emit (events.js:192:7)
18 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
18 verbose stack     at emitTwo (events.js:106:13)
18 verbose stack     at ChildProcess.emit (events.js:192:7)
18 verbose stack     at maybeClose (internal/child_process.js:890:16)
18 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
19 verbose pkgid @
20 verbose cwd /Volumes/DEV-DRIVE/hypotheekbond/test/jigal
21 verbose Darwin 17.5.0
22 verbose argv "/usr/local/Cellar/node/7.5.0/bin/node" "/usr/local/bin/npm" "run" "production"
23 verbose node v7.5.0
24 verbose npm  v6.1.0
25 error code ELIFECYCLE
26 error errno 1
27 error @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
27 error Exit status 1
28 error Failed at the @ production script.
28 error This is probably not a problem with npm. There is likely additional logging output above.
29 verbose exit [ 1, true ]
24 Apr
1 year ago

dubbeltje started a new conversation Installing Tailwindcss On Laravel 5.6

Hello everyone,

I have followed this guide: https://nick-basile.com/blog/post/setting-up-tailwind-in-a-laravel-project to install Tailwindcss on my Laravel project.

However when I run npm run dev I see that a mix-manifest.json is emitted but no app.css is generated.

Any suggestions?

25 Jan
1 year ago

dubbeltje left a reply on Variable Not Set In Twig

I Fixed it.

 <form action="{{ route('files.index.delete',  file.files_id ) }}" method="POST">

The array was unnecessary and I had the wrong Id. Thanks for helping.

dubbeltje started a new conversation Variable Not Set In Twig

Hello,

I'm using twig in my vier wiles and I try to create a route which will delete a file. However, the code below produces the following link:

<form action="{{ route('files.delete', {'id' : file.id }) }}" method="POST">

Output

site.local/file/delete

Without the Id of the file.

How can I get the Id of the file in my URL?

Thanks.

07 Jul
2 years ago

dubbeltje started a new conversation Loading Css Files With Vue

Hello,

I have created a Component which uses tinyMce. I installed tinyMce with npm. Now it requires some stylesheets for the themes. These stylesheets are in the tinyMce directory within the node_modules directory. Should I copy the styles with mix to a directory in my project or is there another way this should be done?

28 Jun
2 years ago

dubbeltje started a new conversation Embed Images Using Mailgun And Twig

Hello,

We are using L.5.4 in combination with twig as template engine for the views of the emails and we are sending the mails with mailgun.

Does anyone know how I can embed images with twig and mailgun? In blade you can use $message->embed('path/to/image') but this doesn't work in twig.

I tried this:

 {% set url = 'https://site.com/images/img.svg' %}
                                <img src="{{ message->embed(url) }}" style="width: 300px; margin-bottom: 9px;"
                                     border="0" alt="Logo">

But this doesn't work. I get the error:

Unexpected token "operator" of value ">" in "//resources/views/emails/appointment.twig" at line 19."

All suggestions are very much appreciated.

Thanks.

27 Jun
2 years ago

dubbeltje left a reply on Laravel Not Logging Anyting

Ok Guys,

So i found out the issue. The issue was that we were using Bugsnag. However Bugsnag was always loaded via a serviceprovider and it tried to write logfiles to production.

So no I solved this by removing the serviceprovider from config/app.php and adding it to the Appserviceprovider like so:

 if ($this->app->environment('production')) {
            $this->app->register(BugsnagServiceProvider::class);

            $this->app->alias('bugsnag.logger', Log::class);
            $this->app->alias('bugsnag.logger', LoggerInterface::class);
        }

Thanks @IgorBabko for helping me in the right direction.

dubbeltje left a reply on Laravel Not Logging Anyting

@IgorBabko

This is what i have in my app.php

'log' => 'daily',
'log_level' => 'debug',

dubbeltje started a new conversation Laravel Not Logging Anyting

Hello,

In my L5.4 application I am trying to write errors or logs to a file in the logs directory. I Set my APP_DEBUG to true. Checked my rights everything seems fine. No log file is created and nothing is logged.

I have done so many things to get this working:

php artisan optimize
chmod 755 storage -R
php artisan clear:cache

But it just doesn't work. Looking for the golden suggestion. Thanks.

06 Feb
2 years ago

dubbeltje left a reply on ConvertEmptyStringsToNull Middleware For What!?

It is to stop doing empty checks all over your codebase.

05 Feb
2 years ago

dubbeltje left a reply on Non Existing Records Does Not Return Null

@Snapey exactly. But I would want to get a null response. B/c the record does not exist in the database.

dubbeltje started a new conversation Non Existing Records Does Not Return Null

Hello, I have 7 records in my Post table. Now when I fetch records > 7 I would expect to get null as a result.

However, the result of dd(Post::where('id', 100)->pluck('body') === null); is false. In fact it returns an empty collection. I would expect it to be null.

Any suggestions?

Thanks very much.

Running on laravel 5.3.26

15 Jan
2 years ago
13 Jan
2 years ago

dubbeltje started a new conversation Connecting To A My Database On Forge

Hello,

I have a digital ocean droplet on forge. Now I want to connect to the database on it's server from phpstorm. I made a connection via Database Sources and Drivers and when I press "Test Connection" i get the message that the connection was succesfull.

But when i try to do a query: "Select * From mydatabase.users" I get the following error in my console:

[2017-01-13 11:10:35] [08S01] Communications link failure
[2017-01-13 11:10:35] The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
[2017-01-13 11:10:35] java.net.ConnectException: Connection refused

Any suggestions?

Thanks

11 Jan
2 years ago

dubbeltje left a reply on Htmlspecialchars() Expects Parameter 1 To Be String

Can you maybe provide a better error message? Possible a stacktrace with line numbers? This will make it easier to help out.