Member Since 1 Year Ago

Experience Points 2,820
Experience Level 1

2,180 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 23
Best Reply Awards 0
Best Reply
  • 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.


    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.


    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.

26 May
3 months ago

jerschmidt14 left a reply on Security In Controller

Great stuff. Thank-you for the examples and the links! Very helpful.

I am reviewing the tutorial as well as you have mentioned. The query scope will be useful on a few of the sections on my website!

Thanks again,


25 May
3 months ago

jerschmidt14 left a reply on Security In Controller

I think i have it. Change the controller to

$this->middleware('auth'); $this->middleware('role:widgets');

then in the role middleware change the handle to

public function handle($request, Closure $next, $role)

Now i can access the "widgets" value from the $role variable.


jerschmidt14 left a reply on Security In Controller


I added another middleware (rolecheck) call in the contructor.

e.g. $this->middleware('auth'); $this->middleware('rolecheck');

with this in the rolecheck middleware i can access the auth()->id())

now, is there a way i can pass in a parameter to the rollcheck?

Ideally for the widgets controller, i would like to pass a string parameter of "widgets" to it. Seems i can access the $request in the middleware. Can i assign something to the request, or directly pass in a string variable? My code is in public function handle($reuqest, Closure $next)

24 May
3 months ago

jerschmidt14 started a new conversation Security In Controller

I have noticed that each controller has a construct method. I have separated my code functionality into individual controllers (e.g. run admin functionality, run query functionality). i would like to restrict access to the controllers for each role of the user. i can easily check to see if the user is part of the roll via a db call. can i do the check in the construct of the controller, or is there a better place to do this?

23 Mar
5 months ago

jerschmidt14 left a reply on Modal Form Bootstrap

Thanks Cronix! Will give a try. BTW, for anyone looking, i have found an example.

jerschmidt14 left a reply on Modal Form Bootstrap

Hi Cronix. Thanks for the response! I was thinking of this as well, but the problem is that the table list is on a stateless page. You can't be sure when the last time it was refreshed (could be hours). if another user comes in and edits, it will be an issue. i want to load the values at the time the person clicks the edit button. I think i will try doing an ajax call to the rest controller, send all the values back using json, and then load them at the time. was hoping for an example, but i will try it out. as well, i would like the table to be dynamically refreshed on the page without an ugly Postback (page refresh). I will try this using a div around the table and refreshing the html inside.


22 Mar
5 months ago

jerschmidt14 started a new conversation Modal Form Bootstrap


I have a table on the screen that shows some of the fields on the record, but not all. I want to click a button and just pass the Id back hopefully to a controller (that way you get a fresh set of data from the database as well in case of concurrency issues). I was hoping to store the form for the modal in a blade housing a bootstrap form and use an include in the section for the modal form. Normally for a simple page, i would call a controller (passing the id) that returns the view, but this is a little different. is there any example on passing a variable number of fields to the blade? or do i write PHP database code in the blade? All the examples i have seen just pass up the data that is in the table on the screen, which isn't what i need.


Field1 Field2 Field3 abc def 123 Edit Delete

Opens up a model form with


Field 2 < def >

field 3 <123 >

field 4

field 5

field 6

SAVE, close



14 Feb
7 months ago

jerschmidt14 left a reply on Base URL

Hi Singnar and Snapey,

Thank-you for your solutions! I got the one from Signar to work. My issue was that i didn't have to URL rewrite installed. Works like charm! Thanks again.

 I don't have control of DNS where i work, so my choice was to use virtual directories.  



13 Feb
7 months ago

jerschmidt14 started a new conversation Base URL

Hi, so I want to host my app in iis. I have many apps running and each has its own virtual directory. I have Laravel working on it. Well almost. To get to my app you go http://server/appname. I noticed that my routes don’t work route(‘/test’). And I put all links in as {{ url(‘/route’) }} in the blades. Is there anyway to override the route and URL functions so that they would return /app name/route without me making a mess and hard Coding? I tried putting in the app.php but doesn’t seem to work. I did notice people overriding some methods but being as I am a noob, I need to know specific files to put code in. I am using Laravel 5.7. Thanks in advance!

30 Jun
1 year ago

jerschmidt14 left a reply on Return Array From Stored Procedure


Thanks to everyone who replied!

I ended using pluck and writing a wrapper function for it.

private function ArrayToKevValue($arrayIn,$keyColumn,$valueColumn) {

return (Arr::pluck($ArrayIn,$valueColumn,$keyColumn));


BTW, ensure to include his library:

use Illuminate\Support\Arr;

However, this does seem like such as waste (doing a foreach to load it after it is already loaded). Loading into a format I don't want, and then converting it back.

Good news though. I did find another article that you can get the connection, and use that to loop through a pdo array, which seems to be more my liking. I am interested in speed of load. In case you are interested, check out:

at the bottom a poster called cokercake showed an example. I will try this out in future.

Being an old C++ coder, I just hate wasting cycles AND I want fast web pages.


28 Jun
1 year ago

jerschmidt14 started a new conversation Return Array From Stored Procedure

Hi, I want the results from a stored proc into an array with key and value. In laravel from a select i can do:


i get an array like

[0] = 'jeremy' [1] = 'test'

however, when i do

\DB::connection('testdb')->select("call up_test('1');");

i get an array like

0 => {#1313 ▼ +"keyid": "0" +"valuecolumn": "test" }

which i don't want. I would like in a standard array like the pluck does.



17 Apr
1 year ago

jerschmidt14 left a reply on Unique Indexes On A Composite Key

Thank you! I will give this a try.

15 Apr
1 year ago

jerschmidt14 started a new conversation Unique Indexes On A Composite Key

I have a table that has a unique composite key (car,city). I also have a unique id on the table for Laravel. I would like to make sure that nobody inserts the same car, city when one already exists. So i defined a unique key in mysql on my table. I would like to trap this error, and display a friendly on back to the user. Is it best to put this error trapping in the controller, or should i do something in the model instead? What is the best way?

06 Apr
1 year ago

jerschmidt14 left a reply on Default Values On Save

I think i am getting closer. I have put this in the BaseModel class which extends model. I use this class for all of my models. I only want to update "TestValue" if i have the attribute on the model. Still doesn't seem to be setting, although the code is called. I put in a sample value of 2, however in the real world, i will be setting to the value returned from a function.

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class BaseModel extends Model { public static function boot() {

  static::saving(function ($model) {
     if (array_key_exists('TestValue',$model)) {
      $model->TestValue = 2; 






jerschmidt14 left a reply on Default Values On Save

Hi jlrdw. I don't want to use the controller to do this as i have many referencing the model. I would like to default the value inside the model everytime someone saves (insert or update).

jerschmidt14 started a new conversation Default Values On Save

Hi, i would like to override field value(s) when i do a save. I would like to put this in the model, so that every time a save is called, it will default the value. That way i don't have to create custom save routines for each model. I have tried putting in a dd, but it seems it is never being called.

public function __save ($name_equals = null, array $options = array()) { $this->attributes['Testfield'] = 55; //dd('I am here'); // Do great things...

        parent::save($options); // Calls Default Save

I have also tried doing without success public $attributes = ['TestField' => 55'];

As well above doesn't allow me to call a function to set the field (which i would also like to do).

28 Mar
1 year ago

jerschmidt14 left a reply on Laravel Recommended Host

Ok. Thanks Everyone!

jerschmidt14 started a new conversation Laravel Recommended Host

Hi, We are looking at hosting our Laravel app. All the development seems to point to using Apache. We would like to use IIS because it allows us to us windows authentication. Are there any drawbacks of using Laravel on IIS? I did a POC, and it seems to work fine.



jerschmidt14 left a reply on Authentication

Thanks Snapey! I found the issue. I have put the code in a middleware component instead and referenced in the kernel.php. This allows it to run every time the page loads. I think it wasn't remembering I was logged in between postbacks. I execute the routing as one of the last middleware calls. Works well.

27 Mar
1 year ago

jerschmidt14 started a new conversation Authentication

I am trying to auto-login a user. I have put the following code in a controller. I access the control from a route post.

    if (Auth::guest())
        print_r("You are currently a guest.<br />");
        if ($result) {                        
            $user = User::find(611);               //hardcoded user id in database
            print_r("Guest Flag \n");
            if (Auth::guest()) {
                print_r("User Logged in");
            return redirect("/");           

Every time i call the page, it shows User Logged in, along with the details of userid 611 which is correct. However, when i redirect to the same page, it does a login again. As well, the rest of my app shows Auth::guest() = true. It seems it is only logged in for the one page?