kkatwork

kkatwork

Member Since 1 Year Ago

Experience Points
36,710
Total
Experience

3,290 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
339
Lessons
Completed
Best Reply Awards
1
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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 8
36,710 XP
Aug
02
1 week ago
Activity icon

Replied to Javascript Events Sometimes Don't Work

Is it because that element is dynamically generated? I guess, In that case it shouldn't work at all.

Activity icon

Replied to Javascript Events Sometimes Don't Work

@bugsysha Thanks for the reply! It is a single video element not multiple. The video element is dynamically added inside a modal.

Aug
01
1 week ago
Activity icon

Started a new Conversation Javascript Events Sometimes Don't Work

Hello,

In my application I am using javascript video element events like, onplaying, onpause, onstalled etc.

The problem is, these elements do not get fired everytime. It works good and after sometime it doesn't. Using the same browser. Tried in different browsers, sometimes events fire, sometimes don't.

The video elemnt is dynamically created and it is inside a modal. The modal is shown after video element is created inside it's body. This all is a part of ajax request success method of jquery.

I have tried to add event listeners after adding the dynamic html. I have also tried to attach listners immediately after document is ready.

I have attached some code..

$('#abcModalBody').empty();
    // console.log("Body emptied");
    // AJAX request
    $.ajax({
        url: '/abc/url',
        type: 'post',
        data: {transId: id},
        success: function(response){
            data = JSON.parse(response);
            if(addHtmlToModal()) {
                addVideoEventListeners();
                // Display Modal
                $('#abcModal').modal('show');
            }
        }
    })
function addVideoEventListeners() {
    video = document.getElementById('video');
    // console.log(video);
    fillItemsTime();
    if (video && firstItemsTime() > 0) {
        video.onplay = function() {
            // alert("Play event fired");
            console.log('play event fired');
        }
        video.onplaying = function() {
            startDisplay();
        }

        video.onpause = function() {
            // console.log("Paused");
            clearTimeout(timer);
        }

        video.onwaiting = function() {
            // console.log("waiting event fired");
            clearTimeout(timer);
        }

        video.onstalled = function() {
            clearTimeout(timer);
        }

        video.onseeking = function() {
            // console.log("seeking");
            clearClassesOfAllRows();
            clearTimeout(timer);
        }

        video.onended = function() {
            index = 0;
            clearClassesOfAllRows();
        }
    }
    // console.log("Before play");
    video.oncanplaythrough = function() {
        // console.log("video can be played now");
        $('#video').get(0).play();
    }
}
Jun
29
1 month ago
Activity icon

Replied to Factory Doesn't Save The Value Of Random Integer To Db?

@mvd Thank you for the reply.

I emptied my database table and tinkered as it is and it worked. Can't guess what was wrong.

Jun
28
1 month ago
Activity icon

Started a new Conversation Factory Doesn't Save The Value Of Random Integer To Db?

Hello I have following factory to create fake database records.

I want to generate a random number in the range 1 to 15 in category id but all I get is 0 in the database.

How do I make this work?

$factory->define(Form::class, function (Faker $faker) {
    $date = now()->startOfMonth();
    $noOfDays = rand(1, 30);
    $cId = rand(1, 15);
    return [
        'user_id'           =>  1,
        'provider_id'       =>  4,
        'notice_basic_id'   =>  null,
        'category_id'       =>  $cId,
        'type'              =>  'terminate',
        'name'              =>  $faker->firstName(),
        'email'             =>  $faker->email,
        'street'            =>  $faker->streetAddress,
        'city'              =>  $faker->city,
        'birthdate'         =>  '23.01.1991',
        'customernr'        =>  '123456',
        'phone'             =>  '987654321',
        'file_path'         =>  'my_file_path',
        'created_at'        =>  $date->addDays($noOfDays)->format('Y-m-d H:i:s'),
        'updated_at'        =>  now()
    ];
});

When I use tinker, it shows the category_id as desired. But in the database all records have cateogry_id 0.

Jun
22
1 month ago
Activity icon

Awarded Best Reply on I Got Some Error When I'm Installing Any Package, Help

Remove unisharp/laravel-ckeditor entry from your composer.json.

Then run composer udpate

Activity icon

Replied to I Got Some Error When I'm Installing Any Package, Help

Remove unisharp/laravel-ckeditor entry from your composer.json.

Then run composer udpate

Jun
20
1 month ago
Activity icon

Started a new Conversation Authentication Between Subdomains

Hi,

Is it possible to have a single Login page and redirect the user to different laravel applications which are on different subdomains??

Ex. A user with A type will go to A subdomain. User with B username will go to B subdomain. Each domain has similar but different laravel apps.

User A should not have access to subdomain B.

Also I want a super use who as auth access to all subdomains.?

Any ideas?

Jun
18
1 month ago
Activity icon

Replied to Single Authentication Point Which Will Redirect To Subdomain.

Does it work if each subdomain has it's own laravel?

Activity icon

Started a new Conversation Single Authentication Point Which Will Redirect To Subdomain.

Hi,

Is it possible to have a single Login page and redirect the user to different laravel applications which are on different subdomains??

Ex. A user with A type will go to A subdomain. User with B username will go to B subdomain. Each domain has similar but different laravel apps.

Also I want a super use who as auth access to all subdomains.?

Any ideas?

May
11
2 months ago
Activity icon

Replied to No Method Works From Mounted() Vuejs

@nakov It worked! thanks.

I have one question, why doesn't that same declaration of ref work inside methods: {} ??

May
09
3 months ago
Activity icon

Started a new Conversation No Method Works From Mounted() Vuejs

Hi,

See the code inside if statement bl_scanning_status is 1. When my code hit that line,

I get 'this.whatever is not a function' error in console.

I tried with different function, tried retyping the whole code, tried 'this' instead of ref. , also tried this.$emit and ref.$emit from the mounted() function.

What can be the issue?

mounted() {
    setInterval(function(){
      var ref = this;

                $.ajax({
                  url: "/checkblock.php",
                  success: function(data) {
                    var json=JSON.parse(data);
                    console.log("checkblog data", data);
                    var bl_scanning_status=json.bl_scanning_status;
                    var bl_hand_status=json.bl_hand_status;
                    var bl_barcode_status=json.bl_barcode_status;
                    var bl_dual_product_status=json.bl_dual_product_status;

                    if(bl_scanning_status == 1){
                      ref.unknownFixed();
                    }

                }
              });

    }, 1000)
  },

  methods: {
    fixUnknown() {
      var ref = this;
      ref.$emit('fixUnknown');
    },
    unknownFixed() {
      var ref = this;
      ref.$emit('unknownFixed');
    },
  }
May
07
3 months ago
Activity icon

Replied to Trait 'Illuminate\Foundation\Auth\AuthenticatesUsers' Not Found

Thank you guys, @siangboon @michaloravec @jlrdw

Everybody's answer helped me!

I installed that package using

composer require laravel/ui

But It worked without " php aritsan ui vue--auth " ? The old code was of Laravel 5.4. I wonder how it worked without php artisan command.

Activity icon

Replied to Trait 'Illuminate\Foundation\Auth\AuthenticatesUsers' Not Found

@siangboon Yes, you are right. I copied the old code to laravel 7.

May
06
3 months ago
Activity icon

Started a new Conversation Trait 'Illuminate\Foundation\Auth\AuthenticatesUsers' Not Found

Hello,

I am not able to figure out the solution for the above error in 'login' route.

Trait 'Illuminate\Foundation\Auth\AuthenticatesUsers' not found

I haven't touched anything in those files.

Error is thrown at LoginController. app\Http\Controllers\Frontend\Auth\LoginController.php:18

Any suggestions? Please help.

Same with the 'register' route. Trait 'Illuminate\Foundation\Auth\RegistersUsers' not found

May
05
3 months ago
Activity icon

Replied to How To Use Old Service Providers In Laravel 7?

@artcore access() is the custom helper function in the project.

Anyways, I found the solution. Thank you.

May
04
3 months ago
Activity icon

Started a new Conversation How To Use Old Service Providers In Laravel 7?

Hi, I have a 5.4 laravel project, which I want to upgrade to laravel 7. I have created a new Laravel 7 project and copied the required files from old project including providers. It is medium sized project.

I have one provider which attaches logged-in-user to every view. But, my views throws an undefined variable 'logged-in-user' error. I can not make it optional because it is used in almost every view.

I guess the service provide isn't working with laravel 7. Composer service provider

class ComposerServiceProvider extends ServiceProvider
{
    /**
     * Register bindings in the container.
     *
     * @return void
     */
    public function boot()
    {

        /*
         * Global
         */
        View::composer(
            // This class binds the $logged_in_user variable to every view
            '*', GlobalComposer::class
        );

        /*
         * Frontend
         */

        /*
         * Backend
         */
        View::composer(
            // This binds items like number of users pending approval when account approval is set to true
            'backend.includes.sidebar', SidebarComposer::class
        );
    }

GlobalComposer class

<?php

namespace App\Http\Composers;

use Illuminate\View\View;

/**
 * Class GlobalComposer.
 */
class GlobalComposer
{
    /**
     * Bind data to the view.
     *
     * @param View $view
     *
     * @return void
     */
    public function compose(View $view)
    {

        $view->with('logged_in_user', access()->user());
    }
}
Mar
14
4 months ago
Activity icon

Replied to Behat/mink-extension Installation Error

I afraid, Laravel 7 won't work if I remove symfony/http-Kernel v 5.0.5.

Activity icon

Started a new Conversation Behat/mink-extension Installation Error

Hi,

I am trying to install behat in my Laravel 7 project to play with BDD.

The installation of behat/behat , behat/mink go well. But behat/mink-extension throws following issue and installation fails

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install behat/mink-extension 2.3.1
    - Conclusion: remove symfony/http-kernel v5.0.5
    - Installation request for behat/mink-extension ^2.3 -> satisfiable by behat/mink-extension[2.3.0, 2.3.1].
    - Conclusion: don't install symfony/http-kernel v5.0.5
    - behat/mink-extension 2.3.0 requires symfony/config ^2.7|^3.0|^4.0 -> satisfiable by symfony/config[2.7.x-dev, 2.8.x-dev, 3.0.x-dev, 3.1.x-dev, 3.2.x-dev, 3.3.x-dev, 3.4.x-dev, 4.0.x-dev, 4.1.x-dev, 4.2.x-dev, 4.3.x-dev, 4.4.x-dev, v2.7.0, v2.7.0-BETA1, v2.7.0-BETA2, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.17, v2.7.18, v2.7.19, v2.7.2, v2.7.20, v2.7.21, v2.7.22, v2.7.23, v2.7.24, v2.7.25, v2.7.26, v2.7.27, v2.7.28, v2.7.29, v2.7.3, v2.7.30, v2.7.31, v2.7.32, v2.7.33, v2.7.34, v2.7.35, v2.7.36, v2.7.37, v2.7.38, v2.7.39, v2.7.4, v2.7.40, v2.7.41, v2.7.42, v2.7.43, v2.7.44, v2.7.45, v2.7.46, v2.7.47, v2.7.48, v2.7.49, v2.7.5, v2.7.50, v2.7.51, v2.7.6, v2.7.7, v2.7.8, v2.7.9, v2.8.0, v2.8.0-BETA1, v2.8.1, v2.8.10, v2.8.11, v2.8.12, v2.8.13, v2.8.14, v2.8.15, v2.8.16, v2.8.17, v2.8.18, v2.8.19, v2.8.2, v2.8.20, v2.8.21, v2.8.22, v2.8.23, v2.8.24, v2.8.25, v2.8.26, v2.8.27, v2.8.28, v2.8.29, v2.8.3, v2.8.30, v2.8.31, v2.8.32, v2.8.33, v2.8.34, v2.8.35, v2.8.36, v2.8.37, v2.8.38, v2.8.39, v2.8.4, v2.8.40, v2.8.41, v2.8.42, v2.8.43, v2.8.44, v2.8.45, v2.8.46, v2.8.47, v2.8.48, v2.8.49, v2.8.5, v2.8.50, v2.8.52, v2.8.6, v2.8.7, v2.8.8, v2.8.9, v3.0.0, v3.0.0-BETA1, v3.0.1, v3.0.2, v3.0.3, v3.0.4, v3.0.5, v3.0.6, v3.0.7, v3.0.8, v3.0.9, v3.1.0, v3.1.0-BETA1, v3.1.0-RC1, v3.1.1, v3.1.10, v3.1.2, v3.1.3, v3.1.4, v3.1.5, v3.1.6, v3.1.7, v3.1.8, v3.1.9, v3.2.0, v3.2.0-BETA1, v3.2.0-RC1, v3.2.0-RC2, v3.2.1, v3.2.10, v3.2.11, v3.2.12, v3.2.13, v3.2.14, v3.2.2, v3.2.3, v3.2.4, v3.2.5, v3.2.6, v3.2.7, v3.2.8, v3.2.9, v3.3.0, v3.3.0-BETA1, v3.3.0-RC1, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.17, v3.3.18, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.0-BETA1, v3.4.0-BETA2, v3.4.0-BETA3, v3.4.0-BETA4, v3.4.0-RC1, v3.4.0-RC2, v3.4.1, v3.4.10, v3.4.11, v3.4.12, v3.4.13, v3.4.14, v3.4.15, v3.4.16, v3.4.17, v3.4.18, v3.4.19, v3.4.2, v3.4.20, v3.4.21, v3.4.22, v3.4.23, v3.4.24, v3.4.25, v3.4.26, v3.4.27, v3.4.28, v3.4.29, v3.4.3, v3.4.30, v3.4.31, v3.4.32, v3.4.33, v3.4.34, v3.4.35, v3.4.36, v3.4.37, v3.4.38, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v3.4.9, v4.0.0, v4.0.0-BETA1, v4.0.0-BETA2, v4.0.0-BETA3, v4.0.0-BETA4, v4.0.0-RC1, v4.0.0-RC2, v4.0.1, v4.0.10, v4.0.11, v4.0.12, v4.0.13, v4.0.14, v4.0.15, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8, v4.0.9, v4.1.0, v4.1.0-BETA1, v4.1.0-BETA2, v4.1.0-BETA3, v4.1.1, v4.1.10, v4.1.11, v4.1.12, v4.1.2, v4.1.3, v4.1.4, v4.1.5, v4.1.6, v4.1.7, v4.1.8, v4.1.9, v4.2.0, v4.2.0-BETA1, v4.2.0-BETA2, v4.2.0-RC1, v4.2.1, v4.2.10, v4.2.11, v4.2.12, v4.2.2, v4.2.3, v4.2.4, v4.2.5, v4.2.6, v4.2.7, v4.2.8, v4.2.9, v4.3.0, v4.3.0-BETA1, v4.3.0-BETA2, v4.3.0-RC1, v4.3.1, v4.3.10, v4.3.11, v4.3.2, v4.3.3, v4.3.4, v4.3.5, v4.3.6, v4.3.7, v4.3.8, v4.3.9, v4.4.0, v4.4.0-BETA1, v4.4.0-BETA2, v4.4.0-RC1, v4.4.1, v4.4.2, v4.4.3, v4.4.4, v4.4.5].
    - symfony/config 2.7.x-dev conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config 2.8.x-dev conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config 3.0.x-dev conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config 3.1.x-dev conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config 3.2.x-dev conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config 3.3.x-dev conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config 3.4.x-dev conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config 4.0.x-dev conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config 4.1.x-dev conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config 4.2.x-dev conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config 4.3.x-dev conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config 4.4.x-dev conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.0 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.0-BETA1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.0-BETA2 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.10 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.11 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.12 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.13 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.14 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.15 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.16 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.17 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.18 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.19 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.2 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.20 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.21 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.22 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.23 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.24 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.25 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.26 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.27 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.28 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.29 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.3 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.30 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.31 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.32 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.33 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.34 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.35 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.36 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.37 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.38 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.39 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.4 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.40 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.41 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.42 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.43 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.44 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.45 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.46 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.47 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.48 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.49 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.5 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.50 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.51 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.6 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.7 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.8 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.7.9 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.0 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.0-BETA1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.10 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.11 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.12 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.13 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.14 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.15 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.16 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.17 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.18 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.19 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.2 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.20 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.21 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.22 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.23 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.24 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.25 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.26 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.27 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.28 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.29 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.3 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.30 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.31 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.32 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.33 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.34 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.35 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.36 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.37 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.38 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.39 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.4 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.40 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.41 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.42 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.43 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.44 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.45 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.46 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.47 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.48 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.49 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.5 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.50 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.52 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.6 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.7 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.8 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v2.8.9 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.0.0 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.0.0-BETA1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.0.1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.0.2 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.0.3 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.0.4 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.0.5 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.0.6 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.0.7 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.0.8 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.0.9 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.1.0 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.1.0-BETA1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.1.0-RC1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.1.1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.1.10 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.1.2 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.1.3 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.1.4 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.1.5 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.1.6 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.1.7 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.1.8 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.1.9 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.2.0 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.2.0-BETA1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.2.0-RC1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.2.0-RC2 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.2.1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.2.10 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.2.11 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.2.12 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.2.13 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.2.14 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.2.2 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.2.3 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.2.4 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.2.5 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.2.6 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.2.7 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.2.8 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.2.9 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.3.0 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.3.0-BETA1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.3.0-RC1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.3.1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.3.10 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.3.11 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.3.12 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.3.13 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.3.14 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.3.15 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.3.16 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.3.17 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.3.18 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.3.2 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.3.3 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.3.4 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.3.5 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.3.6 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.3.7 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.3.8 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.3.9 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.0 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.0-BETA1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.0-BETA2 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.0-BETA3 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.0-BETA4 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.0-RC1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.0-RC2 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.10 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.11 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.12 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.13 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.14 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.15 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.16 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.17 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.18 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.19 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.2 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.20 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.21 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.22 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.23 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.24 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.25 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.26 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.27 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.28 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.29 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.3 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.30 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.31 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.32 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.33 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.34 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.35 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.36 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.37 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.38 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.4 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.5 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.6 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.7 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.8 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v3.4.9 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.0.0 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.0.0-BETA1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.0.0-BETA2 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.0.0-BETA3 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.0.0-BETA4 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.0.0-RC1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.0.0-RC2 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.0.1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.0.10 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.0.11 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.0.12 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.0.13 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.0.14 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.0.15 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.0.2 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.0.3 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.0.4 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.0.5 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.0.6 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.0.7 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.0.8 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.0.9 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.1.0 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.1.0-BETA1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.1.0-BETA2 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.1.0-BETA3 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.1.1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.1.10 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.1.11 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.1.12 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.1.2 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.1.3 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.1.4 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.1.5 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.1.6 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.1.7 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.1.8 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.1.9 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.2.0 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.2.0-BETA1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.2.0-BETA2 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.2.0-RC1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.2.1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.2.10 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.2.11 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.2.12 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.2.2 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.2.3 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.2.4 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.2.5 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.2.6 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.2.7 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.2.8 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.2.9 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.3.0 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.3.0-BETA1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.3.0-BETA2 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.3.0-RC1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.3.1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.3.10 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.3.11 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.3.2 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.3.3 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.3.4 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.3.5 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.3.6 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.3.7 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.3.8 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.3.9 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.4.0 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.4.0-BETA1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.4.0-BETA2 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.4.0-RC1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.4.1 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.4.2 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.4.3 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.4.4 conflicts with symfony/http-kernel[v5.0.5].
    - symfony/config v4.4.5 conflicts with symfony/http-kernel[v5.0.5].
    - Installation request for symfony/http-kernel (locked at v5.0.5) -> satisfiable by symfony/http-kernel[v5.0.5].


Any help?

Activity icon

Replied to When To Use PHPSpec, Behat And PHPUnit

Helped me! thanks :)

Mar
13
4 months ago
Activity icon

Started a new Conversation TDD Vs. BDD

Since I am a member of Laracasts, I have been following Jeffrey's style of TDD. I have watched more than half of the 'forum' series and I really like TDD now. I am using this approach in my projects.

However, recently I came to know about phpspec and behat. Because, it was stated in one of the job listing that Behat and PHPspec knowledge is preferred.

I searched for Behat watched jeffrey's single available video on that. Honestly, I am impressed with this BDD. It is so good that you can describe the feature that way, scenarios are like steps to develop a feature. It is like we can document what we want from the application!

But, my question is, is it really worth to BDD? Does it replace TDD? Should I use BDD for my projects? (I liked it when I first got to know about Behat! Yesterday) Do I still need to follow the same TDD under BDD? How to start and develop Laravel projects using Behat and phpspec ? Why did't Jeffrey use BDD when creating forum series?

Veterans, please guide me :)

Mar
09
5 months ago
Activity icon

Replied to Resolve Different Classes In Service Container?

@sinnbeck Thanks. Laravel is wonderful! I like it more. I wish I could remember all the things :D

Activity icon

Replied to Resolve Different Classes In Service Container?

@sinnbeck

I did it. It works! My question was, if there is really a need of my likeable 'interface' in this condition?

Activity icon

Replied to Resolve Different Classes In Service Container?

@sinnbeck

Do I need to bind anything in AppServiceProvider if I use dynamic route model binding? will it automatically do the job in my controller?

Activity icon

Replied to Resolve Different Classes In Service Container?

@sinnbeck

I think, it is unable to get the model instance using route model binding?

Activity icon

Replied to Resolve Different Classes In Service Container?

@sinnbeck

If I write like this, the error is my interface is not instantiable !

 app()->when(LikesController::class)
        ->needs(LikeableContract::class)
        ->give( function() {
            if(request()->type == 'news') {
                return new News();
            }
            else if (request()->type == 'guide') {
                return new CommunityGuide();
            }
        });
Activity icon

Replied to Resolve Different Classes In Service Container?

Sir, I am using it 1 controller. Not in two controllers.

I just want the model in store method of my LikesController.

It throws NOT NULL constrain violation for the likeable_id ! How to return news() or guide() model as required? both are using 'slug' as route model key name. I hope you understood, sir.

Note : I didn't know about contextual binding.. I Don't know how to use in this condition.

Activity icon

Started a new Conversation Resolve Different Classes In Service Container?

Hi,

I have two 'Model' classes which implements an interface. I am using route model binding to get the models of these two classes.

I want to resolve the Model automatically , for that I am using the interface in the controller method.

But, it doesn't work. Please check. It is hard to explain for me.

app()->bind(LikeableContract::class, function() {
            // $name = request()->type;
            // return (new \ReflectionClass($name))->newInstance();
            return new News(); // or return new Guide(); 
            /** Here I want to produce different classes with the route model binding */
        });

I tried to write comment in code to explain.

Here is my method in the controller.

public function store(LikeableContract $likable)
    {
        $likable->like();
        return back();
    }

Please tell me how this works?

Mar
07
5 months ago
Activity icon

Replied to Can't Use Create() Method On Relationship When There Are Hidden Attribute On The Model To Be Created.

@sinnbeck Thank you, it worked. I wonder how an array creation from a factory is related to hidden attributes?

Does the $hidden attribute not apply only to the database records? Does it apply to the every model instance?

Activity icon

Replied to Can't Use Create() Method On Relationship When There Are Hidden Attribute On The Model To Be Created.

I am using this in my test.

$user->gameAccounts()->create($this->make('App\GameAccount')->toArray());
Activity icon

Replied to Can't Use Create() Method On Relationship When There Are Hidden Attribute On The Model To Be Created.

@sinnbeck I am sorry for that. But, it wasn't a copy paste. It was a typo here. It's not a prblem on original code

Activity icon

Replied to Can't Use Create() Method On Relationship When There Are Hidden Attribute On The Model To Be Created.

@sinnbeck No $fillable attribute.

class GameAccount extends Model
{
    protected $guarded = [];

    protected $hidden = ['password', 'secret_answer'];

    public function getRouteKeyName()
    {
        return 'nickname';
    }

Illuminate\Database\QueryException: SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: game_accounts.password

Note : I am using factory for game account and it is filled properly. I use make()->toArray(). on that factory

Activity icon

Replied to Can't Use Create() Method On Relationship When There Are Hidden Attribute On The Model To Be Created.

@sinnbeck Yes. $guarded is empty array. It should fill all the attributes, right?

Activity icon

Started a new Conversation Can't Use Create() Method On Relationship When There Are Hidden Attribute On The Model To Be Created.

Hello,

I have got an issue. I have a relationship in my project like this.

  1. User -> has many Game Accounts
  2. Game Account -> belongs to a User

I want to make 'hidden' some attributes of Game Account Model. Like, we hide password on user Model.

Now, the problem is When I add those fields in $hidden attribute on Game Account Model. I can't create relationship.

E.g. when I have 'secret_question' inside $hidden attribute of GameAccounts model, then I can't use

$user->gameAccounts()->create(['secret_answer' => 'blah blah']); 

Specially, I am using it in testing.

It throws mysql NOT NULL constraint violation error. Is create method unable to write values of 'hidden' attribute? I hope my writting is understandable.

Mar
06
5 months ago
Feb
23
5 months ago
Activity icon

Replied to Laravel Debugbar Problem

My mistake. I didn't clear out the cache after commenting jquery. Problem is solved. Thank you. Network tab is great!

Activity icon

Replied to Laravel Debugbar Problem

I found that there is one .php file reference from a jquery.twitter.js file . I commented out whole jquery.twitter.js file but the problem is not solved.

Not it shows that get-tweets.php is not found . But I don't need it and I don't have it in my project. I don't know how to find the exact reference to it. I also made a 'search' in all files.

Activity icon

Started a new Conversation Laravel Debugbar Problem

Hello,

I have installed Laravel debugbar to track queries and mails etc. But when page is loading the queries are shown but after the page reload completes they queries and views tabs show 0. Because of that, I can't check anything.

What can be the reason of vanishing of queries and views information from debugbar? Also one exception is shown on every page load. Not Found exception

vendor\laravel\framework\src\Illuminate\Routing\RouteCollection.php#179

Feb
22
5 months ago
Activity icon

Replied to User Model Doesn't Recognize New Attributes

Make sure you have 'migrated' the changes. If you edited the migration file.

Activity icon

Replied to Laracasts - Thoughts? Opinions? Roadmap To Proper Use?

Yes. Laracasts is worth it. I have been a continuous member since 11 months. Never though of ending the subscription. I have not taken full advantage of 11 months. But, I have learned a lot. I didn't know anything about Test Driven Development before. Now, I know that TDD is a very good approach to develop a website.

You should know Object Oriented PHP.

Start with 'Laravel 6 from scratch' series. It is also a good idea to read the Laravel Documentation often. Because you can't remember all the functions at once.

Feb
20
5 months ago
Activity icon

Replied to Nope

@jlrdw it is sad there are a lot of copy paste programmers. Something should be done regarding the free feeding of codes on internet. Real programs aren't getting enough rom their hard work. And many websites run on shit code. People just don't care!

Activity icon

Replied to Trying To Get Property 'name' Of Non-object (View: C:\xampp\htdocs\supportcrm\resources\views\admin\artticletag\show.blade.php)

@neeraj1005 There are many solutions to each problem. My question was about what's best , not about just going with random something which works. Anyways, glad to see that your code is working now :) Thanks

Activity icon

Replied to Nope

ha ha . interesting one btw.

Activity icon

Replied to Git And Refactoring Of Code

@sinnbeck Yes. Thank you.

Activity icon

Replied to Trying To Get Property 'name' Of Non-object (View: C:\xampp\htdocs\supportcrm\resources\views\admin\artticletag\show.blade.php)

@sinnbeck great. Can you please tell me the additional benefit of try and catch block in this case? Which we don't get by if statement? I like your answer it seems more polished approach.

Activity icon

Replied to Trying To Get Property 'name' Of Non-object (View: C:\xampp\htdocs\supportcrm\resources\views\admin\artticletag\show.blade.php)

Do something like this in show method.

if (! $tags->count() ) {
    abort(404); 
}

Create a custom file named 404.blade.php in resources/views/errors/

Activity icon

Replied to Git And Refactoring Of Code

How about refactoring on master branch itself? @sinnbeck

Activity icon

Replied to Trying To Get Property 'name' Of Non-object (View: C:\xampp\htdocs\supportcrm\resources\views\admin\artticletag\show.blade.php)

Check your artticletag\show.blade.php file . You must be referring name property of something which is not passed as an object to your view. Check the controller which you are using to return this view. Check the data which you pass to this view.

Activity icon

Started a new Conversation Git And Refactoring Of Code

Hello,

I have done a good progress on a project. But, I know there is a need to do a lot of refactoring.

I want to ask if I should create a new Git Branch from master branch to refactor the code?? Because refactoring can lead to many conflicts? Will it be possible to merge the refactor branch back to master?

Have you done such thing? Give me tips for refactoring using git. I do TDD.

Activity icon

Replied to Help With Git

@deemo If you want to use it as a new project or on different machine.

If you clone the repository as a new project. This .env file won't be included in that new project.

You will need to run composer install this will install laravel, php artisan key:generate. and rename .env.example file to .env and add your own db credentials in that.