infernobass7

infernobass7

Member Since 4 Years Ago

Lebanon

Programmer/Analyst at The Farfield Company

Experience Points 38,435
Experience Level 8

1,565 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 318
Lessons
Completed
Best Reply Awards 15
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.

17 May
2 months ago

infernobass7 left a reply on Is It Possible To Prioritize A Package's Routes?

Hey I am not sure if you are still running into this issue. I ran into something similar but mine issue was with another third-party package and with Laravel's package Auto-discover feature, I wanted to find another way.

You can hook into the application after it has finished booting other providers, using the following function.

App::booted(function() {
        Route::get('{any}', '[email protected]')->where('any', '^.*$');
});
09 Jan
2 years ago

infernobass7 left a reply on Nested Components, AJAX, And Passed Data

I believe the issue that you are having is that the field component is being created before the ajax request is returned with a value. Try setting a default value for the loadedValue:

props: {
    'field',
    'label',
    'loadedValue': {
        default: ''
    },
    'userId'
}

Before doing the above can you also console.log your response? I believe you are trying to grab the data in the wrong spot. I normally use:

function(data) {
    this.loadedData = data.data
}

So you might need to use response.data instead of response.body

infernobass7 left a reply on Why Does This Not Work?

Are you using vue 1 or vue 2?

infernobass7 left a reply on Model Observers

Oddly, when I performed a composer update everything worked perfectly.

06 Jan
2 years ago

infernobass7 left a reply on Model Observers

I am not sure what mean by this because the namespacing in the file seems to be correct:

<?php

namespace App\Providers;

use App\Observers\ToolObserver;
use App\Tool;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        Tool::observe(ToolObserver::class);
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}

05 Jan
2 years ago

infernobass7 left a reply on Model Observers

Tool is created by passing an array from the request object.

$tool = Tool::create($request->except(['needs_inspection','frequency','most_recent']));

infernobass7 left a reply on Model Observers

If I use dd() it still redirects to the correct url and the log does not have anything in it.

infernobass7 started a new conversation Model Observers

I recently stumbled upon Model Observers and I am trying to implement them on a model but whenever I create a model nothing happens.

Controller:

public function store(Request $request)
    {
        if(auth()->user()->cannot('create-' . strtolower($this->model))) {
            return redirect('/');
        }

        if( ! $request->has('charge_jobs')) {
            $request->merge(['charge_jobs' => 0]);
        }

        if($request->has('charge_jobs') && $request->charge_jobs) {
            $request->merge(['rate' => $this->calculateRateFromPurchasePrice(request('purchase_price'))]);
        } else {
            $request->merge(['rate' => 0.01]);
        }

        $this->validate($request, [
            'id' => 'required|string|unique:tools,id',
            'description' => 'required|string',
            'model' => 'nullable|string',
            'serial' => 'nullable|string',
            'vendor' => 'nullable|numeric',
            'purchase_date' => 'required|date',
            'purchase_price' => 'required|numeric|min:0',
            'rate' => 'required|numeric|min:0',
            'charge_jobs' => 'required|boolean',
            'manufacturer' => 'required|string',
        ]);

        $tool = Tool::create($request->except(['needs_inspection','frequency','most_recent']));

        if($request->needs_inspection) {
            $tool->inspection()->associate(new Inspection($request->only(['frequency','most_recent'])));

            $tool->save();
        }

        return redirect()->action(studly_case($this->model) . '[email protected]');
    }

Observer for Tool Model:

<?php

namespace App\Observers;

use App\Events\Event;
use App\Events\SystemWasModified;
use App\Events\ToolWasTransferred;
use App\Tool;
use Illuminate\Support\Facades\Log;

class ToolObserver
{
    /**
     * Listen to the Tool created event.
     *
     * @param  Tool  $user
     * @return void
     */
    public function created(Tool $tool)
    {
        Log::info('Tool created!');
        $this->firePickEvent($tool, 'create');

        Event::fire(new ToolWasTransferred($tool, $tool->createTransferAudit('100')));
    }

    /**
     * Listen to the Tool deleting event.
     *
     * @param  Tool  $user
     * @return void
     */
    public function deleting(Tool $tool)
    {
        //
    }

    /**
     * Listen to the Tool updated event.
     *
     * @param  Tool  $user
     * @return void
     */
    public function updated(Tool $tool)
    {
        $this->firePickEvent($tool, 'update');
    }

    protected function firePickEvent($tool, $type) {
        Event::fire(new SystemWasModified('tool', $type, $tool->id, $tool->pickAttributes(), false));
    }
}

AppServiceProvider boot method:


    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        Tool::observe(ToolObserver::class);
    }

Any advice on why this is not working is greatly appreciated.

infernobass7 left a reply on Component Vs Child Vue Instance

I have not found any downside to performance but I have noticed that multiple instances can get rather annoying especially if you need to share data between the instances.

I recently switched to using vuex in one of my projects and it greatly cleaned up my components. It stores your data and the logic behind that data. For example I had two components that interacted with the same piece of data. Moving it to Vuex it removed all of the event code that really bloated my components and the methods that I copied from one component to the other now was in one location.

The one thing I have not been able to figure out is how to make the vue load faster while the page is loading.

Let me know if you need help converting to Vuex. It was fairly simple but there where times it got frustrating for me.

28 Nov
2 years ago

infernobass7 started a new conversation Authentication Wrappers

Does anyone know why the wrappers for the the different authentication methods on the controllers were removed? Before there was a method (ie. getLogin), that you could overwrite in your LoginController to allow for additional logic to be processed. However, now if you want to overwrite the default method you have to copy the entire default method to the LoginController.

21 Nov
2 years ago

infernobass7 started a new conversation Vue 2.0 Events

I am not sure if I am missing something but I have been scouring the vue documentation all morning trying to figure this out. I am upgrading an application from vue 1.0 to 2.0. I have 2 events that laravel Echo catch and then pass data down to the component to use. I have tried to use this.$emit in order to accomplish this with the following events method to catch the event but nothing happens:

events: {
    transfer: function(data) {
        var log = data.log;
        var print = data.print;
        console.log('TAL',log);
        this.transfers.push(log);
        if(print) {
            console.log(log);
            this.printTransferSheet(log);
        }
    }
}

Any help will be appreciated.

15 Sep
2 years ago

infernobass7 started a new conversation Production Optimization

I have one app file that is supposed to load the components that are required on the page. However, when I load a page you can tell that the page is taking a little while to get everything situated. I am using gulp --production when compiling. Can anyone give me suggestions on how to make it load smoother?

Here is the main JS file that loads the components:

var Vue = require('vue');
var Pusher = require('pusher-js');

import Resource from 'vue-resource';
import VueSweetAlert from 'vue-sweetalert';


Vue.use(Resource);
Vue.use(VueSweetAlert);

import Navigation from "./components/layouts/Navigation.vue";
import List from "./components/layouts/List.vue";

Vue.http.headers.common['X-CSRF-TOKEN'] = document.querySelector('meta[name="csrf-token"]').getAttribute('content');

Vue.component('permissions', function (resolve, reject) {
    resolve(require("./components/forms/Permissions.vue"));
});

Vue.component('create-permissions', function (resolve, reject) {
    resolve(require("./components/forms/CreatePermissions.vue"));
});

Vue.component('transfer-tool', function (resolve, reject) {
    resolve(require("./components/forms/TransferTool.vue"));
});

Vue.component('transfer-expendable', function (resolve, reject) {
    resolve(require("./components/forms/TransferExpendable.vue"));
});

Vue.component('transfer-audit-log', function (resolve, reject) {
    resolve(require("./components/layouts/TransferAuditLog.vue"));
});

Vue.component('reports', function (resolve, reject) {
    resolve(require("./components/forms/Reports.vue"));
});

Vue.component('create-tool', function (resolve, reject) {
    resolve(require("./components/forms/CreateTool.vue"));
});

Vue.directive('input-mask', {
    params: ['mask'],

    bind: function () {
        $(this.el).inputmask({
            mask: this.params.mask
        });

    },
});

new Vue({
    el: 'body',

    data: {
        pusher:'',
        pusherChannel:'',
        kiosk: false,
        env: 'local',
        'show_inspections': false,
        price: 0,
        'charge_jobs': false,
    },

    components: {
        Navigation,
        List
    },

    computed:{
        rate() {
            return (Math.round((this.price/800)*100)/100) + 0.03;
        },
        job_rate() {
            return this.charge_jobs ? this.rate : 0.01;
        }
    },

    created() {
        this.kiosk = this.getUrlVars()['toolshop'];
        this.env = document.querySelector('meta[name="env"]').getAttribute('content');
        this.pusher = new Pusher('30eac0b79c537c3e99dc',{encrypted: true});
        this.pusherChannel = this.pusher.subscribe('toolshop');
        this.pusherChannel.bind('item-transferred-' + this.env, function(data) {
            var print = false;
            if(data.log.type == "tool" && this.kiosk && data.log.job != "100") {
                print = true;
            }
            this.$broadcast('itemTransferred',data.log, print);
        }.bind(this));
    },

    methods: {
        selectChange(option) {
            this.$broadcast('select-change',option);
        },
        getUrlVars() {
            var vars = {};
            var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
                vars[key] = value;
            });
            return vars;
        }
    }
});
02 Sep
2 years ago

infernobass7 left a reply on Check If A Model Uses Soft Deleting

Basically I have a master page that uses information passed down to render the model results. Not all models that are passed to the master page will be soft deleting models. So I want to be able to check whether or not the model uses soft deleting. Kinda like the solution provided here: http://laravel.io/forum/03-15-2014-how-to-determine-if-model-support-soft-deleting

infernobass7 started a new conversation Check If A Model Uses Soft Deleting

I am trying to find out if there is a way to find out if a model is soft deleting from the view.

26 Aug
2 years ago

infernobass7 left a reply on Vue-strap Datepicker Not Working

I have been having more and more problems. Especially, if reference it wrong and you get browserify failed for every file in vue-strap.

infernobass7 left a reply on Vue-strap Datepicker Not Working

Anybody have this issue?

infernobass7 left a reply on Class Not Found Exception

I finally found my issue. I forgot to restart the queue worker so it was using the old version of the code.

25 Aug
2 years ago

infernobass7 left a reply on Class Not Found Exception

I have tried dumping the autoloaded files as well as clearing the compiled code

infernobass7 started a new conversation Class Not Found Exceptio

I created a console job to handle sending emails nightly. However, I keep getting this error in production. If I run the exact same code in my local development environment it does not throw any exceptions and works perfectly. Also, if I open php tinker it does not have any issues with finding the class.

Exception:

[2016-08-25 11:26:03] production.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Class 'App\Employee' not found in /home/forge/farfield.local/app/Jobs/SendToolshopTransferNotices.php:40
Stack trace:
#0 [internal function]: App\Jobs\SendToolshopTransferNotices->handle(Object(Illuminate\Mail\Mailer))
#1 /home/forge/farfield.local/vendor/laravel/framework/src/Illuminate/Container/Container.php(507): call_user_func_array(Array, Array)
#2 /home/forge/farfield.local/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(81): Illuminate\Container\Container->call(Array)
#3 [internal function]: Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}(Object(App\Jobs\SendToolshopTransferNotices))
#4 /home/forge/farfield.local/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(150): call_user_func(Object(Closure), Object(App\Jobs\SendToolshopTransferNotices))
#5 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(App\Jobs\SendToolshopTransferNotices))
#6 /home/forge/farfield.local/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): call_user_func(Object(Closure), Object(App\Jobs\SendToolshopTransferNotices))
#7 /home/forge/farfield.local/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(82): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#8 /home/forge/farfield.local/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(41): Illuminate\Bus\Dispatcher->dispatchNow(Object(App\Jobs\SendToolshopTransferNotices))
#9 /home/forge/farfield.local/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(130): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\BeanstalkdJob), Array)
#10 /home/forge/farfield.local/vendor/laravel/framework/src/Illuminate/Queue/Jobs/BeanstalkdJob.php(53): Illuminate\Queue\Jobs\Job->resolveAndFire(Array)
#11 /home/forge/farfield.local/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(213): Illuminate\Queue\Jobs\BeanstalkdJob->fire()
#12 /home/forge/farfield.local/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(156): Illuminate\Queue\Worker->process('beanstalkd', Object(Illuminate\Queue\Jobs\BeanstalkdJob), '3', 0)
#13 /home/forge/farfield.local/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(111): Illuminate\Queue\Worker->pop('beanstalkd', 'default', 0, '10', '3')
#14 /home/forge/farfield.local/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(85): Illuminate\Queue\Worker->runNextJobForDaemon('beanstalkd', 'default', 0, '10', '3')
#15 /home/forge/farfield.local/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(119): Illuminate\Queue\Worker->daemon('beanstalkd', 'default', 0, 128, '10', '3')
#16 /home/forge/farfield.local/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(78): Illuminate\Queue\Console\WorkCommand->runWorker('beanstalkd', 'default', 0, 128, true)
#17 [internal function]: Illuminate\Queue\Console\WorkCommand->fire()
#18 /home/forge/farfield.local/vendor/laravel/framework/src/Illuminate/Container/Container.php(507): call_user_func_array(Array, Array)
#19 /home/forge/farfield.local/vendor/laravel/framework/src/Illuminate/Console/Command.php(169): Illuminate\Container\Container->call(Array)
#20 /home/forge/farfield.local/vendor/symfony/console/Command/Command.php(256): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 /home/forge/farfield.local/vendor/laravel/framework/src/Illuminate/Console/Command.php(155): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 /home/forge/farfield.local/vendor/symfony/console/Application.php(791): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 /home/forge/farfield.local/vendor/symfony/console/Application.php(186): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#24 /home/forge/farfield.local/vendor/symfony/console/Application.php(117): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#25 /home/forge/farfield.local/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 /home/forge/farfield.local/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 {main}

Job File:

<?php

namespace App\Jobs;

use App\TransferAudit;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Mail;

class SendToolshopTransferNotices extends Job implements ShouldQueue
{
    use InteractsWithQueue, SerializesModels;

    protected $job_id;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($job_id)
    {
        $this->job_id = $job_id;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        $job = DB::connection('mongodb2')->collection('jobs')->where('number', intval($this->job_id))->first();
        $employee = \App\Employee::find(
            isset($job['field_supervisor_id']) ? $job['field_supervisor_id'] : $job['contract_manager_id']
        );

        $transfers = TransferAudit::toJob($this->job_id)->get();

        Mail::send('emails.toolshop.transfers',
            [
                'tools' => $transfers->filter(function($value,$key) { return $value->type == "tool"; }),
                'expendables' => $transfers->filter(function($value,$key) { return $value->type == "expendable"; }),
                'job' => $job,
                'employee' => $employee,
            ],
            function($m) use ($employee, $job) {
                //$employee['email']
                $m->to('[email protected]', $employee['firstName'] . ' ' . $employee['lastName']);
                $m->from('[email protected]', 'Farfield Toolshop');
                $m->subject('Tools and Expendables transferred to Job ' . $job['number']);
            }
        );
    }
}

Model File:

<?php

namespace App;

use App\Model;

class Employee extends Model
{

    protected $fillable = [
        'id', 'firstName', 'middleName', 'lastName', 'suffix', 'ssn', 'dob',
        'doh', 'gender', 'military', 'marital'
    ];

    public $connection = 'mongodb2';
    public $collection = 'people';
    protected $primaryKey = '_id';
    public $incrementing = false;

    public function addresses() {
        //return $this->embedsMany();
    }

    public function getSupervisorAttribute($value) {
        return Employee::find($value);
    }

    public function getNameAttribute($value) {
        return $this->firstName . " " . $this->middleName . " " . $this->lastName;
    }

    public function supervisor() {
        return $this->belongsTo(Employee::class,'id','supervisor');
    }

    public function subordinates() {
        return $this->hasMany(Employee::class,'supervisor','id');
    }
}
21 Aug
2 years ago

infernobass7 started a new conversation Vue-strap Datepicker Not Working

I have tried both version 1.0.11 and 1.0.10 and neither one work. I am trying to disable days based on the selection above the datepicker. Basically if they chose a value that is a sunday I want everything else to be disabled. Everything I have tried it passes in the array of disabled days but it won't disable those days to make it where the user can only choose that day of the week.

My Vue file:

<template>
    <div class="col-xs-12">
        <label for="session">Skate session preference:</label>
        <br>
        <select id="session" name="session" class="form-control" v-model="selectedSessionId">
            <option value="">Select a Session</option>
            <option :value="session.id" v-for="session in sessions">{{session.session_description}}</option>
        </select>
        <datepicker
                :value.sync="selectedDate"
                :disabled-days-of-Week="getDays"
                format="yyyy-MM-dd"
        >
        </datepicker>
    </div>
</template>

<script>
    var Datepicker = require('vue-strap/dist/vue-strap.min').datepicker;
    export default{
        data(){
            return{

            }
        },
        computed: {
            selectedSession() {
                if(this.selectedSessionId != "") {
                    for(var session in this.sessions) {
                        if(this.sessions[session].id == this.selectedSessionId) {
                            return this.sessions[session];
                        }
                    }
                } else {
                    return "";
                }
            },
            getDays() {
                var avail = [0,1,2,3,4,5,6];
                if(this.selectedSessionId != "") {
                    return avail.filter( function(day) {
                        return day != this.selectedSession.day;
                    }.bind(this));
                } else {
                    return [];
                }
            }
        },
        components:{
            'datepicker':Datepicker
        },
        props:{
            sessions:{
                default() {
                    return [];
                }
            },
            selectedSessionId:{
                default:""
            },
            selectedDate:{
                default:""
            }
        }
    }
</script>

Here is a screen capture of the data being passed in and the datepicker itself where you can see that it is not disabling days. datepicker

19 Aug
2 years ago

infernobass7 left a reply on Eager Loading With Laravel 5.3

I found the issue. I am using laravel-mongodb and the log never showed that it was in the Mongo package.

infernobass7 left a reply on Eager Loading With Laravel 5.3

    public function groups() {
        return $this->belongsToMany(Group::class,null,'permission_ids','group_ids');
    }

Before updating to laravel 5.3 this works perfectly fine.

infernobass7 started a new conversation Eager Loading With Laravel 5.3

After I updated to Laravel 5.3, I get the following error when trying to eager load.

[2016-08-19 08:38:04] local.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function all() on array in /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:617
Stack trace:
#0 /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(322): Illuminate\Database\Eloquent\Builder->getModels(Array)
#1 /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(632): Illuminate\Database\Eloquent\Builder->get(Array)
#2 /home/vagrant/data-ms/app/Providers/AuthServiceProvider.php(45): Illuminate\Database\Eloquent\Model::all()
#3 /home/vagrant/data-ms/app/Providers/AuthServiceProvider.php(36): App\Providers\AuthServiceProvider->getPermissions()
#4 [internal function]: App\Providers\AuthServiceProvider->boot(Object(Illuminate\Auth\Access\Gate))
#5 /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Container/Container.php(507): call_user_func_array(Array, Array)
#6 /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(759): Illuminate\Container\Container->call(Array)
#7 /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(742): Illuminate\Foundation\Application->bootProvider(Object(App\Providers\AuthServiceProvider))
#8 [internal function]: Illuminate\Foundation\Application->Illuminate\Foundation\{closure}(Object(App\Providers\AuthServiceProvider), 18)
#9 /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(743): array_walk(Array, Object(Closure))
#10 /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\Foundation\Application->boot()
#11 /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(203): Illuminate\Foundation\Bootstrap\BootProviders->bootstrap(Object(Illuminate\Foundation\Application))
#12 /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(249): Illuminate\Foundation\Application->bootstrapWith(Array)
#13 /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(144): Illuminate\Foundation\Http\Kernel->bootstrap()
#14 /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#15 /home/vagrant/data-ms/public/index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#16 {main}  

Here is the spot that the code fails:

    protected function getPermissions()
    {
        return Permission::with('groups')->get();
    }

Switching it to the following gives the same error:

    protected function getPermissions()
    {
        return Permission::all()->load('groups');
    }
15 Aug
2 years ago

infernobass7 left a reply on Forge Down

I think it was down only momentarily. I got a 504 gateway timeout and using isitdownrightnow.com got that it was down to but it seems to be fine now.

infernobass7 started a new conversation Forge Down

Is anyone else having problems getting to Forge?

15 Jul
3 years ago

infernobass7 left a reply on Events And Queue

Thank you for your help.

infernobass7 left a reply on Events And Queue

@d3xt3r if I run that it works but is there a way to run it without requiring me to execute the command every time?

infernobass7 left a reply on Vue-for-Idea

What version are you using?

infernobass7 left a reply on Events And Queue

Can anyone help with this?

14 Jul
3 years ago

infernobass7 started a new conversation Events And Queue

I am trying to set up using events with beanstalkd and pusher. If use beanstalkd as by queue driver, nothing happens and no message is transmitted to pusher. However, if I use the sync driver it works like it should and everything get transmitted correctly. Any suggestions would be greatly appreciated?

16 Jun
3 years ago

infernobass7 started a new conversation How Does Laravel Spark Work?

Does Laravel Spark work like the basic Laravel works with using views or does it run mainly off of Vue Components?

Also, is there anyway to work with Spark before purchasing it?

02 Jun
3 years ago

infernobass7 left a reply on Authentication Succeeds But Acts Like It Fails

I just removed adldap and checked both the database and file. Before the login is submitted there is not a session and then after it is created and persist but somehow the session is changing from when it is submitted to when the user is redirected to the home page after logging in

Process shown below: Login form is displayed no Session Login form is submitted Session ID in the authenticate middleware. Login form is redisplayed and no session

[2016-06-02 15:23:07] local.INFO: Login Form Session:   
[2016-06-02 15:23:13] local.INFO: Login Submission Session: 5b1066bb8119cf3aed3cf181697254389be75b95  
[2016-06-02 15:23:14] local.INFO: Auth Session: a4432bc0d64e62dcde10023d8863932b873f3865  
[2016-06-02 15:23:14] local.INFO: Login Form Session:   

infernobass7 started a new conversation Authentication Succeeds But Acts Like It Fails

So I am working on updating from laravel 5.1 to 5.2 and my Authentication page fails. When you submit incorrect credentials it fails like it should. However, when you submit valid credentials, it takes you back to the login page like you were never logged in. I am using the standard AuthController with ADLDAP2-laravel to connect to Active Directory (If I deactivate ADLDAP2-laravel, it still gives me issues.)

The only part that is different in my Authcontroller is the postLogin method (Attached below). All this does is prevent outside users from registering to the site unless they are an Employee of the company.

public function postLogin(Request $request) {
        if(DB::table('ids')->where('username', '=', $request->username)
                ->where('EmpID','=',$request->password)->count()==1) {
            return redirect("register")->withInput([
                'username'=>$request->only($this->loginUsername())['username'],
                'EmpID'=>$request->only('password')['password']
            ]);
        }
        
        return $this->login($request);
    }

I am not sure what other code you need to see. Please let me know.

09 May
3 years ago

infernobass7 left a reply on Cannot Connect To Mysql Through Gui, Access Denied

Have you tried executing this command in the commandline connection:

grant all privileges on YOURDB.* to 'YOURUSER'@'localhost' identified by 'YOURPASSWORD';

It sounds like the Authentication table is not set up correctly.

05 May
3 years ago

infernobass7 left a reply on How Does Laravel Forge Work?

Thank you @noeldiaz That is pretty much all I need on the server is nginx and ubuntu.

04 May
3 years ago

infernobass7 left a reply on How Does Laravel Forge Work?

Thank you for the update.

infernobass7 started a new conversation How Does Laravel Forge Work?

I have seen the features page but I am wondering how does it really interact with the server. I have been building applications for my Company that are for internal and external use. We have servers that are hosted on the company network that are not publicly facing. The IT Manager wants to know a little bit more about how it functions before he open up any ports for it. Does any one know the best way to use forge with private servers? Like is there a way to run the functions that forge does without the server being publicly accessible.

26 Apr
3 years ago

infernobass7 left a reply on Post Request Losing Data

@premsaurav Thank you. I completely missed that. I had a modal for quickly adding employee/company records that referenced the same fields.

infernobass7 left a reply on Post Request Losing Data

@EmilMoe if I remove one of the fields that is populating from fillable it still shows up but the others that are not showing are in the fillable too. The form is filled in from the Model correctly. I get an issue between when I hit submit and when Laravel processes the validation rules on the Request object.

infernobass7 left a reply on Post Request Losing Data

Here is the JobRequest object where I am dumping the data:

class JobRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return Auth::guest() ? false : true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        dd($this);
        return [
            'number' => 'required|alpha_dash',
            'title' => 'required|min:3|max:200',
            'value' => 'required|numeric',
            'description' => 'required',
            'status' => 'required',
            'contract-manager' => 'required|exists:employees,_id',
            'field-supervisor' => 'required|exists:employees,_id',
            'companies' => 'array',
            'companies.*' => 'exists:companies,_id',
            'roles' => 'array',
            'roles.*' => 'exists:roles,name',
        ];
    }

infernobass7 left a reply on Post Request Losing Data

Macro for states dropdown:

<?php

Form::macro('states', function($name = "state", $selected = null) {

    $states = array(
        ''=>"Select a State",
        'AL'=>"Alabama",
        'AK'=>"Alaska",
        'AZ'=>"Arizona",
        'AR'=>"Arkansas",
        'CA'=>"California",
        'CO'=>"Colorado",
        'CT'=>"Connecticut",
        'DE'=>"Delaware",
        'DC'=>"District Of Columbia",
        'FL'=>"Florida",
        'GA'=>"Georgia",
        'HI'=>"Hawaii",
        'ID'=>"Idaho",
        'IL'=>"Illinois",
        'IN'=>"Indiana",
        'IA'=>"Iowa",
        'KS'=>"Kansas",
        'KY'=>"Kentucky",
        'LA'=>"Louisiana",
        'ME'=>"Maine",
        'MD'=>"Maryland",
        'MA'=>"Massachusetts",
        'MI'=>"Michigan",
        'MN'=>"Minnesota",
        'MS'=>"Mississippi",
        'MO'=>"Missouri",
        'MT'=>"Montana",
        'NE'=>"Nebraska",
        'NV'=>"Nevada",
        'NH'=>"New Hampshire",
        'NJ'=>"New Jersey",
        'NM'=>"New Mexico",
        'NY'=>"New York",
        'NC'=>"North Carolina",
        'ND'=>"North Dakota",
        'OH'=>"Ohio",
        'OK'=>"Oklahoma",
        'OR'=>"Oregon",
        'PA'=>"Pennsylvania",
        'RI'=>"Rhode Island",
        'SC'=>"South Carolina",
        'SD'=>"South Dakota",
        'TN'=>"Tennessee",
        'TX'=>"Texas",
        'UT'=>"Utah",
        'VT'=>"Vermont",
        'VA'=>"Virginia",
        'WA'=>"Washington",
        'WV'=>"West Virginia",
        'WI'=>"Wisconsin",
        'WY'=>"Wyoming"
    );

    $select = '<select name="'.$name.'" class="form-control">';

    foreach ($states as $abbr => $state)
    {
        $select .= '<option value="'.$abbr.'"'.($selected == $abbr ? ' selected="selected"' : '').'>'.$state.'</option> ';
    }

    $select .= '</select>';

    return $select;

});

infernobass7 left a reply on Post Request Losing Data

I just saw this further down the dumped output:

#content: "_method=PATCH&_token=scvHceFCPIZaSI5prXzUBdFOdtwOWUoiEN9KQJVL&number=2982&title=repellendus+sint+consequuntur&address1=37825+Waters+Row&address2=Apt.+304&city=Legroshaven&state=SD&zip=11579-1578&description=Ut+facilis+deserunt+beatae+nisi+culpa+in.+Id+deleniti+architecto+in+omnis+saepe+consequatur+repellendus.+Unde+quaerat+aliquid+ullam+qui.+Vel+et+doloremque+veniam+eligendi.+Eos+maiores+iste+consequatur+qui+quia+aut.&phone=&duration=&status=&contract-manager=&field-supervisor=&title=&address1=&address2=&city=&state=&zip=&companies%5B%5D=5719213b76a1652378003eb2&roles%5B%5D=Owner&companies%5B%5D=571a07a676a1650edc0010d1&roles%5B%5D=Plumbing+Contractor&title=&address1=&address2=&city=&state=&zip="

This has all of the correct information in it but it does not populate the rest of the object correctly. So I am confused why this is.

infernobass7 left a reply on Post Request Losing Data

@EmilMoe before I do validation i am dumping the request object and in the request attributes section I get the two above mentioned outputs.

@premsaurav Yes I am and the second output that is generated from editing an item that has already been created and before hitting submit the fields are all filled with data but after hitting submit certain fields like the title are empty.

@tykus_ikus Yes it is a macro that contains state names and abbreviations.

infernobass7 left a reply on Post Request Losing Data

Here is the result of submitting the edit form:

#parameters: array:17 [▼
      "_method" => "PATCH"
      "_token" => "scvHceFCPIZaSI5prXzUBdFOdtwOWUoiEN9KQJVL"
      "number" => "2982"
      "title" => ""
      "address1" => ""
      "address2" => ""
      "city" => ""
      "state" => ""
      "zip" => ""
      "description" => "Ut facilis deserunt beatae nisi culpa in. Id deleniti architecto in omnis saepe consequatur repellendus. Unde quaerat aliquid ullam qui. Vel et doloremque veniam eligendi. Eos maiores iste consequatur qui quia aut."
      "phone" => ""
      "duration" => ""
      "status" => ""
      "contract-manager" => ""
      "field-supervisor" => ""
      "companies" => array:2 [▼
        0 => "5719213b76a1652378003eb2"
        1 => "571a07a676a1650edc0010d1"
      ]
      "roles" => array:2 [▼
        0 => "Owner"
        1 => "Plumbing Contractor"
      ]
    ]

infernobass7 left a reply on Post Request Losing Data

Create Form Open:

    {!! Form::open(['url'=>'job']) !!}
    @include('jobs.partials.form', ['btnText'=>'Add New Job', 'create'=>true, 'state' => null])
    {!! Form::close() !!}

Edit Form Open:

    {!! Form::model($job,['method' => 'PATCH', 'url' => 'job/'.$job->_id]) !!}
        @include('jobs.partials.form', ['btnText'=>'Update Job Information', 'create'=>false, 'state' => $job->state])
    {!! Form::close() !!}

infernobass7 started a new conversation Post Request Losing Data

I have a form that is being created using laravel collective form builder. When I click submit some of the form values are being removed and sent to the server as blank. I have not been able to figure out why this is.

Main Form:

<div id="form">
    <div class="panel-group">
        <div class="panel panel-default">
            <div class="panel-heading" data-toggle="collapse" href="#collapseDetails">
                <h4 class="panel-title">
                    Job Details
                </h4>
            </div>
            <div id="collapseDetails" class="panel-collapse collapse">
                <div class="panel-body">
                    @include('jobs.partials.details')
                </div>
            </div>
        </div>
    </div>
    <div class="panel-group">
        <div class="panel panel-default">
            <div class="panel-heading" data-toggle="collapse" href="#collapseEmployees">
                <h4 class="panel-title">
                    Project Employees
                </h4>
            </div>
            <div id="collapseEmployees" class="panel-collapse collapse">
                <div class="panel-body">
                    @include('jobs.partials.employees')
                </div>
            </div>
        </div>
    </div>
    <div class="panel-group">
        <div class="panel panel-default">
            <div class="panel-heading" data-toggle="collapse" href="#collapseParties">
                <h4 class="panel-title">
                    Parties Involved
                </h4>
            </div>
            <div id="collapseParties" class="panel-collapse collapse">
                <div class="panel-body">
                    @include('jobs.partials.parties')
                </div>
            </div>
        </div>
    </div>
</div>
<!-- Submit Form -->
<div class="form-group">
    {!! Form::submit($btnText, ['class'=>'btn btn-primary']) !!}
</div>

Details Form:

<!-- number Form Input -->
<div class="form-group" id="jobno">
    {!! Form::label('number', 'Job Number:') !!}
    {!! Form::text('number', null, ['class'=>'form-control']) !!}
</div>
<!-- name Form Input -->
<div class="form-group">
    {!! Form::label('title', 'Job Name:') !!}
    {!! Form::text('title', null, ['class'=>'form-control']) !!}
</div>
@include('addresses.partials.form')
<!-- Desc Form Input -->
<div class="form-group">
    {!! Form::label('description', 'Description:') !!}
    {!! Form::textarea('description', null, ['class'=>'form-control']) !!}
</div>
<!-- phone Form Input -->
<div class="form-group">
    {!! Form::label('phone', 'Job Phone Number:') !!}
    {!! Form::tel('phone', null, ['class'=>'form-control']) !!}
</div>
<!-- duration Form Input -->
<div class="form-group">
    {!! Form::label('duration', 'Duration:') !!}
    {!! Form::text('duration', null, ['class'=>'form-control']) !!}
</div>
<!-- Job Status Form Input -->
<div class="form-group">
    {!! Form::label('status', 'Job Status:') !!}
    {!! Form::select('status', ['New Job', 'Active Job (Employees are currently working)', 'Inactive Job (Employees are not currently working)','Closed'], null, ['placeholder'=>'Pick a Status','class'=>'form-control']) !!}
</div>

address form:

<!-- address1 Form Input -->
<div class="form-group">
    {!! Form::label('address1', 'Address Line 1:') !!}
    {!! Form::text('address1', null, ['class'=>'form-control']) !!}
</div>
<!-- address2 Form Input -->
<div class="form-group">
    {!! Form::label('address2', 'Address Line 2:') !!}
    {!! Form::text('address2', null, ['class'=>'form-control']) !!}
</div>
<!-- city Form Input -->
<div class="form-group">
    {!! Form::label('city', 'City:') !!}
    {!! Form::text('city', null, ['class'=>'form-control']) !!}
</div>
<!-- state Form Input -->
<div class="form-group">
    {!! Form::label('state', 'State:') !!}
    {!! Form::states('state', $state) !!}
</div>
<!-- zip Form Input -->
<div class="form-group">
    {!! Form::label('zip', 'Zip:') !!}
    {!! Form::text('zip', null, ['class'=>'form-control']) !!}
</div>

Here is the resulting post request data:

#parameters: array:14 [▼
      "_token" => "scvHceFCPIZaSI5prXzUBdFOdtwOWUoiEN9KQJVL"
      "number" => "9635"
      "title" => ""
      "address1" => ""
      "address2" => ""
      "city" => ""
      "state" => ""
      "zip" => ""
      "description" => ""
      "phone" => ""
      "duration" => ""
      "status" => ""
      "contract-manager" => ""
      "field-supervisor" => ""
    ]
20 Apr
3 years ago

infernobass7 started a new conversation Use Multiple Request Objects To Validate Form Input

I am currently working on a project that has two models: a company model and an address model. Is there a way to use two 'Request' objects to validate form input? The reason I ask is the address model is used on other models in the project as well.

@jeff_way, do you have any suggestions?

19 Apr
3 years ago

infernobass7 left a reply on Laravel + MongoDB Relationships

I figured out my issue. The job needed to belong to the company,which doesn't make too much sense to me for the application. Also, is there a way to add a new relationship from the job class to the company by saving on the job instead of on the company?