kclark6595

kclark6595

Member Since 3 Years Ago

Experience Points 2,130
Experience Level 1

2,870 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 33
Lessons
Completed
Best Reply Awards 0
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.

20 Aug
2 years ago

kclark6595 left a reply on Base Table Or View Not Found: 1146

Grrrrrrrrrrrrrrrr!!!!!

Helps when one adds the table to the same database that the application is reading from !!!!!!

kclark6595 left a reply on Base Table Or View Not Found: 1146

@Christopher - Tried that already as an off chance. Its generating the correct table name even without, its just that for some reason, it cant see it in the databse

kclark6595 started a new conversation Base Table Or View Not Found: 1146

Just added a new table to my database: unittypes

My migration file (create_unittypes_table.php) is:

<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUnittypesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('unittypes', function (Blueprint $table) {
            $table->integer('id');
            $table->string('description',25);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('unittypes');
    }
}

My Models file (Unittype.php) is:

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Unittype extends Model
{
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'id', 'description',
    ];

    /**
     * The attributes excluded from the model's JSON form.
     *
     * @var array
     */
    protected $hidden = [
        
    ];
}

The error I get is:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 't4r.unittypes' doesn't exist (SQL: select * from `unittypes` order by `description` asc)

I have verified that the table unittypes exists and is populated in the database (I can even run the sql code generated in the error just fine)

For whatever reason, the application is not seeing the table. It reads from teh other tables in the application just fine, just not that one.

I am feeling that I have left out a line of code somewhere, but am clueless as to where.

Keith

15 Jun
3 years ago

kclark6595 started a new conversation RESOLVED: CURL

Sorry, not sure how to remove the question, no sooner than I added it I found my type.

26 May
3 years ago

kclark6595 started a new conversation Using Logged In Windows Username For Auth

Hello all. Trying to accomplish what seems like a relatively simple task, but is beating me up pretty good.

I have a Laravel 5.2 application that I would like to be able to authenticate a person to based on the username of the person logged into the computer. Kind of a modified single sign on...once they log into windows, then based on groups they belong to dictate the access they have to the application.

I have already used adLDAP successfully to query our Active Directory servers for group information about a given user, I just need a way to retrieve the username of the person currently logged into the P.C.

I know this can be done through .Net applications, but am hoping there is a way to also do this via a Laravel application.

Thanks in advance for any help.

Keith

03 Feb
3 years ago

kclark6595 left a reply on Use Illuminate\Support\Facades\Input; Vs Use Input In Laravel 5.2

@premsaurav Thanks for that information. Helps a lot. Still relatively new to the Laravel scene, so little things like that kinda toss me a curve.

kclark6595 started a new conversation Use Illuminate\Support\Facades\Input; Vs Use Input In Laravel 5.2

I am trying to figure out why, in Laravel 5.2, I need to use use Illuminate\Support\Facades\Input; in my controllers where I have several Laravel 5.1 projects that only have use Input;

Any light on the subject?

31 Jan
3 years ago

kclark6595 started a new conversation Using Sass/gulp On Laravel 5.2 (Windows) Without The Bloat

Is there a way to use sass with Laravel 5.2 on windows without having to deal with the enormous bloat of nodejs?? (I installed nodejs, npm --global gulp and then npm install, and my laravel install went from approx 6000 files to almost 80,000 !!!! the node_modules folder went CRAZY !!)

The only thing I want to use is gulp, but can one carve it and only it out?

Thanks, Keith

16 Jan
3 years ago

kclark6595 started a new conversation Gulp And Deduping

Just learned the usage of gulp and Elixir. Love the flexibility it gives me in my CSS creation.

Question I have surrounds concatenation of several scss files.

Is there a way to dedupe during gulp? For example:

first.scss contains:

html {
    color: red;
}

body {
    font-size: 1em;
}

second.scss contains:

body {
    font-size: 2em;
} 

I would like the resulting .css file to be:

html {
    color: red;
}

body {
    font-size: 2em;
} 

instead of

html {
    color: red;
}

body {
    font-size: 1em;
}

body {
    font-size: 2em;
}

Thanks for any advice

14 Oct
3 years ago

kclark6595 started a new conversation Composer Breaks When Moving A View To A Subfolder

More of a 'wonder why' than something broken since I can leave files where they currently are.

In my main view, I @include a header view. the header view file resides in the same directory as my main view. I have a composer set up to load an array variable with data when the header view is called. And it works great.

However, if I move my header to a partials folder located in the same directory as the main, and change the @include to point to the new location, when I run the application, it tells me I have an undefined variable in the header file.

I have looked through what code I code find (or more remember where was) and I dont see anything that specifically references paths for the view in the composer.

Is there somewhere I need to look to specifically tell the composers where the view is located?

13 Oct
3 years ago

kclark6595 started a new conversation Fail On Reference To Specific Field

Have a controller function:

    public function pageedit($id)
    {
        $page = Pages::where('pgeID','=',121)->get();
        return view('admin.pageedit')->with('page',$page);
    }

And a simple view:

@extends('admin')

@section('content')
    @include('/partials/adminpageheader')
    Edit Page { { $page } }
@endsection

When I run, I get:

Intranet Web Control Panel (Pages)
Admin Home - Admin Home Page
Edit Page [{"pgeID":"121","pgeActive":"0","pgeContent":"1","pgeMainLevel":"6","pgeLevel":"1","pgeParent":"6","pgeOrder":"3","pgeTitle":"Employee Assistance Program","pgeHeader":"Null","pgeBody":Employee Assistance Program that all employees can access 24\/7. The website, www.assist.com has an amazing amount of information available. If you are looking for training, articles, resources and more, check them out. The use","pgeNav":null,"pgeContents":"Null","pgeCallOut":"Null","pgeEditor":"Null","pgeTitleDRAFT":"Null","pgeTemplateDRAFT":null,"pgeNavDRAFT":null,"pgeContentsDRAFT":"Null","pgeCallOutDRAFT":"Null"}]

If I ty to callout JUST the page title (pgeTitle) in the view using {{ $page->pgeTitle }} I get undefined property. If I use {{ $page['pgeTitle'] }} I get an undefined index.

I know its got to be a simple step I am missing, but dang if I can figure it out

04 Sep
3 years ago

kclark6595 left a reply on Changing Required Fields On Login Page

I did find that near the bottom of that same file there was a section that had 'email' hard coded like 'password' is here.

After some playing around, I found that as long as I name my table field 'password', I could use whatever other field I wanted to authenticate against simply by changing the hard coding of the 'email' field at the bottom of the file.

Unfortunately, there are too many places the 'password' was coded into sections like Guard to make it easy to change that.

So, I changed the field name in my database from 'usrPassword' to 'password' and I am now able to authenticate using 'usrID' and 'password'.

Thanks for pointing me in the right direction.

kclark6595 started a new conversation Changing Required Fields On Login Page

I have a table other than Users that I want to use for authentication.

I updated my config\auth.php file to point to the new table and use the new model:

<?php

return [

    'driver' => 'database',
    'model' => App\Models\tblUsers::class,
    'table' => 'tblUsers',

];

Then I changed my login view:

<form class="form-horizontal" role="form" method="POST" action="{{ url('/auth/login') }}">
    <input type="hidden" name="_token" value="{{ csrf_token() }}">

    <div class="form-group">
        <label class="col-md-4 control-label">User ID</label>
        <div class="col-md-6">
            <input type="text" class="form-control" name="usrID" value="{{ old('usrID') }}">
        </div>
    </div>

    <div class="form-group">
        <label class="col-md-4 control-label">Password</label>
        <div class="col-md-6">
            <input type="password" class="form-control" name="usrPassword">
        </div>
    </div>


    <div class="form-group">
        <div class="col-md-6 col-md-offset-4">
            <button type="submit" class="btn btn-primary">Login</button>
        </div>
    </div>
</form>

I changed email to usrID and password to usrPassword.

I have finally got it to accept that the fields have been filled out, but now I am getting the message that it cant authenticate the user.

Is there any documentation that explains modifiying the built in Auth methods to use different fields or am I better off building the login authorizations from scratch?

03 Sep
3 years ago

kclark6595 left a reply on Laravel 5 On IIS 7.5

Figured it out. Missed the line to add IUSR with full control to the storage folder, not IIS_IUSRS

Doh!

02 Sep
3 years ago

kclark6595 started a new conversation Laravel 5 On IIS 7.5

Yes, I know it seems like this is a dead horse, and that it shouldn't be this hard. Then I remembered I was working with Microsoft products.

I currently have been developing an application off line, using the php built in server. Ready to deploy to our IIS server. Search Laracasts, found several posts on doing so, but no matter what I try, I just get a plain while blank screen. No errors. No nothing. Only time I go any error was a RouteColletion error when the document root was set to c:\inpetpub\wwwroot\public and I tried opening v-webserver/public. Every other combo I tried, including adding teh index.php file, ended in a blank screen.

The one thing that does differ from the instructions was that I did not "install" laravel using composer in my wwwroot folder, I copied my development folder over and changed the .env file accordingly. I dont think this should have caused any issues, but I am very new at Laravel.

I have:

  • verified all my PHP settings (NTS version, extensions, etc. via phpinfo())
  • created my web.config file from the existing .htaccess file I have been using
  • gave full control to the IIS_IUSR user on the storage folder

I am out of options to try

Below is my web.config file:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Imported Rule 1" stopProcessing="true">
                    <match url="^(.*)/$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Redirect" url="/{R:1}" redirectType="Permanent" />
                </rule>
                <rule name="Imported Rule 2" stopProcessing="true">
                    <match url="^" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

kclark6595 left a reply on IIS7 Laravel 5

Ok, at my wits end.

Have a Laravel 5 project I have been building offline, using the built in PHP server to test. Now I want to move to an IIS 7.5 server. Followed all the instructions above and all I get is a blank white screen.

I have verified all my PHP settings via phpinfo. I have added the IIS_IUSR account giving full control to the storage folder I have tried my root folder as c:\inetpub\wwwroot and c:\inetpub\wwwroot\public I have verified index.php is my default doc I even tried deleting my web.config and importing using url_rewrite of IIS, no luck.

The one place I differ from the instructions is the installation of Laravel. Instead of installing via composer, I am copying the main folder from my development location and altering the .env file accordingly.

I was able to get one error message and that was error in RouteCollection.php when I had the folder root set to my public folder and I tried to use v-webserver/public as my URL.

I wouldnt think it should be this hard to do, but then I remembered I am dealing with Microsoft.

Any suggestions of where to check of what I missed? Thanks!

kclark6595 left a reply on Fetching Data From A View

I found that what I needed to use was a composer to load a collection on the view call

26 Aug
3 years ago

kclark6595 left a reply on Fetching Data From A View

What I have (very abbreviated) is:

main.blade.php

<html>
@include('header')
<body>
@section('content')

@stop
</body>
</html>

home.blade.php

@extends('main')

@section('content')
    <h1>Home</h1>
@endsection

Now from the controller, I call the home.blade.php view

Can I fetch the data thats needed in the header view from INSIDE the header file rather than having to pass the data from every view I call? Or do I need to simply create a global function that I call in every controller before I call a view?

kclark6595 started a new conversation Fetching Data From A View

Learning about Laravel. Know how to create a controller that builds an array of data from an Eloquent model, pass that array to a view and display it.

What I am trying to do is create a main view that has the header and footer information all pages use, then use a child view to display the body.

The main blade file has an include for a file that builds a dynamic navigation bar.

How to I go about retrieving data from within the include file the main blade file that's called by a child?

25 Aug
3 years ago

kclark6595 left a reply on Multiple Calls To Same Model Within A Single View

Getting closer!

in my Controller now, I have:

        $level1Navs = tblPages::where('pgeParent','=',0)->orderBy('pgeOrder','ASC')->orderBy('pgeTitle','ASC')->get();
        var_dump($level1Navs);
        foreach($level1Navs as $level1Nav) {
            $navbar = array();
            $navbar['pgeID'] = $level1Nav->pgeID;
            $navbar['pgeTitle'] = $level1Nav->pgeTitle;
            $navbar['pgeContent'] = $level1Nav->pgeContent;
            $navbar['pgeMainLevel'] = $level1Nav->pgeMainLevel;
            $navbar['level2'] = array();

            $level2Navs = tblPages::where('pgeParent','=',$level1Nav->pgeID)->where('pgeActive','=',1)->orderBy('pgeOrder','ASC')->orderBy('pgeTitle','ASC')->get();
            foreach($level2Navs as $level2Nav) {
                $navbar['level2']['pgeID'] = $level2Nav->pgeID;
                $navbar['level2']['pgeTitle'] = $level2Nav->pgeTitle;
                $navbar['level2']['pgeContent'] = $level2Nav->pgeContent;
                $navbar['level2']['pgeMainLevel'] = $level2Nav->pgeMainLevel;
                $navbar['level2']['level3'] = array();

                $level3Navs = tblPages::where('pgeParent', '=', $level2Nav->pgeID)->where('pgeActive', '=', 1)->orderBy('pgeOrder', 'ASC')->get();
                foreach ($level3Navs as $level3Nav) {
                    $navbar['level2']['level3']['pgeID'] = $level3Nav->pgeID;
                    $navbar['level2']['level3']['pgeTitle'] = $level3Nav->pgeTitle;
                    $navbar['level2']['level3']['pgeContent'] = $level3Nav->pgeContent;
                    $navbar['level2']['level3']['pgeMainLevel'] = $level3Nav->pgeMainLevel;

                }
            }
        }

        var_dump($navbar);

There are 9 items off the first level, but when it hits the var_dump, I only get this:

array (size=5)
  'pgeID' => string '10' (length=2)
  'pgeTitle' => string 'News' (length=4)
  'pgeContent' => string '0' (length=1)
  'pgeMainLevel' => string '10' (length=2)
  'level2' => 
    array (size=5)
      'pgeID' => string '50' (length=2)
      'pgeTitle' => string 'News Stories' (length=12)
      'pgeContent' => string '1' (length=1)
      'pgeMainLevel' => string '10' (length=2)
      'level3' => 
        array (size=0)
          empty

Its like its only running through the foreach one time.

Am I missing something simple?

kclark6595 left a reply on Multiple Calls To Same Model Within A Single View

That was my issue. I was brain blocking on how to get code such as the old straight line programming that you called when the output required it, to the new MVC style to where your data is fetched beforehand and then handed off to the view.

Its not impossible to teach old dogs new tricks, we just take a bit (albeit quite a bit) longer.

Thanks for the great responses. Cant wait to try them out tonight

kclark6595 left a reply on Multiple Calls To Same Model Within A Single View

I think I understand that.

I would run the code in the controller, adding each level to the collection, then pass the collection to the view.

I will give that a spin!

Thanks

kclark6595 started a new conversation Multiple Calls To Same Model Within A Single View

Love the concept of MVC programming but very old school top down programmer here. I follow all the concepts of passing a model result set to a view for display, but when it comes to multiple calls and multiple recordsets within one view, this is whats tripping me up.

I current have a simple webpage that has a dynamically built menu bar based on items in a database table. Currently, I use nested foreach statements to build my structure like so:

$sql = 'select pgeContent, pgeTitle, pgeMainLevel, pgeID from tblPages where pgeParent=0 order by pgeOrder, pgeTitle';
$qryLevel1Nav = $conn->query($sql);
$recLevel1Nav = $qryLevel1Nav->fetchAll(PDO::FETCH_ASSOC);

if(!empty($recLevel1Nav)) {
    echo '<ul id="nav">';
        foreach($recLevel1Nav as $rowLevel1Nav) { 
                
                //
                // CODE TO WRITE <li> ENTRIES --- BLOCK REMOVED FOR BRIEVITY
                //
                
                // LEVEL 2 NAV STARTS   
                $sql = 'select pgeContent, pgeTitle, pgeMainLevel, pgeID from tblPages where pgeParent='.$rowLevel1Nav['pgeID'].' and pgeActive=1 ORDER BY pgeOrder, pgeTitle';
                $qryLevel2Nav = $conn->query($sql);
                $recLevel2Nav = $qryLevel2Nav->fetchAll(PDO::FETCH_ASSOC);
            
                if(!empty($recLevel2Nav)) {
                    echo '<ul>';
                    foreach($recLevel2Nav as $rowLevel2Nav) {       

                        //
                        // CODE TO WRITE <li> ENTRIES --- BLOCK REMOVED FOR BRIEVITY
                        //
                                
                        // LEVEL 3 NAV STARTS   
                        $sql = 'select pgeTitle, pgeMainLevel, pgeID from tblPages where pgeParent='.$rowLevel2Nav['pgeID'].' and pgeActive=1 order by pgeOrder asc';
                        $qryLevel3Nav = $conn->query($sql);
                        $recLevel3Nav = $qryLevel3Nav->fetchAll(PDO::FETCH_ASSOC);
                    
                        if(!empty($recLevel3Nav)) {
                            echo '<ul>';
                            foreach($recLevel3Nav as $rowLevel3Nav) {

                            //
                            // CODE TO WRITE <li> ENTRIES --- BLOCK REMOVED FOR BRIEVITY
                            //

                            }   
                            echo '</ul>';
                        }
                        $qryLevel3Nav->closeCursor();
                        // LEVEL 3 NAV ENDS 
                    }   
                    echo '</ul>';
                }
                $qryLevel2Nav->closeCursor();   
                // LEVEL 2 NAV ENDS
            }
        }
    echo '</ul>';
}
$qryLevel1Nav->closeCursor(); 
// LEVEL 1 NAV ENDS     

I am at a loss how I would do this using the MVC framework approach

Any suggestions or suggested readings would be greatly appreciated.

Keith

21 Aug
3 years ago

kclark6595 started a new conversation 'tinker' Flavors

Using git bash as my shell. I call tinker and get a screen much different than the one in the Eloquent 101 video. I am getting the Psy Shell.

Where everything seems to work as indicated, the editing features are much different: no up arrow to repeat last command, no insert function for correcting typing errors, etc.

What shell is tinker using in the video??