Randy_Johnson

Randy_Johnson

Member Since 1 Year Ago

Experience Points 840
Experience Level 1

4,160 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 1
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.

17 Aug
13 hours ago

Randy_Johnson left a reply on Seeder Class Not Found In Laravel5 Seeding

I had an error with the seeder, I fixed all the classes and re ran the command to find the error again. I then ran this:

composer dumpautoload

and everything was working fine. What is this command doing?

16 Aug
1 day ago

Randy_Johnson left a reply on SQLite Driver Installed But Not Seen!

Yeah, I've just done it, and just installed sqlite3. Now I am getting a new error of:

[Fri Aug 16 14:41:33 2019] PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: /usr/lib/php/20170718/pdo_sqlite (/usr/lib/php/20170718/pdo_sqlite: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/pdo_sqlite.so (/usr/lib/php/20170718/pdo_sqlite.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 [Fri Aug 16 14:41:33 2019] PHP Warning: PHP Startup: Unable to load dynamic library 'sqlite3' (tried: /usr/lib/php/20170718/sqlite3 (/usr/lib/php/20170718/sqlite3: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/sqlite3.so (/usr/lib/php/20170718/sqlite3.so: cannot open shared object file: No such file or directory)) in Unknown on line 0.

15 Aug
2 days ago

Randy_Johnson started a new conversation SQLite Driver Installed But Not Seen!

Hi, my sqlite driver has just been installed and I can see it with sqlite command. When I run php artisan migrate I get this error.


  at <font color="#4E9A06">/opt/lampp/htdocs/laravel_tutorials/freecodecamp/vendor/laravel/framework/src/Illuminate/Database/Connection.php</font>:<font color="#4E9A06">664</font>
    <font color="#555753"><i>660| </i></font><font color="#C4A000">        </font><font color="#555753"><i>// If an exception occurs when attempting to run a query, we&apos;ll format the error</i></font>
    <font color="#555753"><i>661|         // message to include the bindings with SQL, which will make this exception a</i></font>
    <font color="#555753"><i>662|         // lot more helpful to the developer instead of just the database&apos;s errors.</i></font>
    <font color="#555753"><i>663|         </i></font><font color="#C4A000">catch (</font><b>Exception $e</b><font color="#C4A000">) {</font>
<span style="background-color:#CC0000"><b>  &gt; </b></span><font color="#555753"><i>664| </i></font><font color="#C4A000">            throw new </font><b>QueryException</b><font color="#C4A000">(</font>
    <font color="#555753"><i>665| </i></font><font color="#C4A000">                </font><b>$query</b><font color="#C4A000">, </font><b>$this</b><font color="#C4A000">-&gt;</font><b>prepareBindings</b><font color="#C4A000">(</font><b>$bindings</b><font color="#C4A000">), </font><b>$e</b>
    <font color="#555753"><i>666| </i></font><b>            </b><font color="#C4A000">);</font>
    <font color="#555753"><i>667| </i></font><font color="#C4A000">        }</font>
    <font color="#555753"><i>668| </i></font>

  <font color="#C4A000">Exception trace:</font>

  <font color="#06989A">1   </font><font color="#C4A000">PDOException::(&quot;could not find driver&quot;)</font>
      <font color="#4E9A06">/opt/lampp/htdocs/laravel_tutorials/freecodecamp/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php</font>:<font color="#4E9A06">70</font>

  <font color="#06989A">2   </font><font color="#C4A000">PDO::__construct(&quot;sqlite:/opt/lampp/htdocs/laravel_tutorials/freecodecamp/database/database.sqlite&quot;, [])</font>
      <font color="#4E9A06">/opt/lampp/htdocs/laravel_tutorials/freecodecamp/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php</font>:<font color="#4E9A06">70</font>

  <font color="#4E9A06">Please use the argument </font><font color="#CC0000">-v</font><font color="#4E9A06"> to see more details.</font>
13 Aug
4 days ago

Randy_Johnson left a reply on Doctrine\DBAL\Driver\PDOException

I get an error message saying

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Randy_Johnson started a new conversation Doctrine\DBAL\Driver\PDOException

I keep running into this problem and I have followed all instructions to fix it but it doesn't seem to be working.

I am running Linux Mint and I have run composer update etc with the message of that everything is up to date.

My composer.json also represents that it is there.

"require": { "php": "^7.1.3", "doctrine/dbal": "^2.9", "fideloper/proxy": "^4.0", "laravel/framework": "5.8.*", "laravel/tinker": "^1.0" },

Please please, I am actually at the stage where I am going to uninstall Linux and reinstall windows.

Illuminate\Database\QueryException : SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = ecommerce and table_name = migrations and table_type = 'BASE TABLE')

at /opt/lampp/htdocs/laravel/ecommerce/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664 660| // If an exception occurs when attempting to run a query, we'll format the error 661| // message to include the bindings with SQL, which will make this exception a 662| // lot more helpful to the developer instead of just the database's errors. 663| catch (Exception $e) {

664| throw new QueryException( 665| $query, $this->prepareBindings($bindings), $e 666| ); 667| } 668|

Exception trace:

1 Doctrine\DBAL\Driver\PDOException::("SQLSTATE[HY000] [2002] No such file or directory") /opt/lampp/htdocs/laravel/ecommerce/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:31

2 PDOException::("SQLSTATE[HY000] [2002] No such file or directory") /opt/lampp/htdocs/laravel/ecommerce/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:27

Please use the argument -v to see more details.

12 Aug
5 days ago

Randy_Johnson left a reply on Bagisto - Base Table Or View Not Found: 1146

I checked the migration files and there was nothing like that, so I ran php artisan migrate anyway and got this.

Illuminate\Database\QueryException : SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = als_tobacco_ltd and table_name = migrations)

at /opt/lampp/htdocs/laravel/bagisto-master/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664 660| // If an exception occurs when attempting to run a query, we'll format the error 661| // message to include the bindings with SQL, which will make this exception a 662| // lot more helpful to the developer instead of just the database's errors. 663| catch (Exception $e) {

664| throw new QueryException( 665| $query, $this->prepareBindings($bindings), $e 666| ); 667| } 668|

Exception trace:

1 Doctrine\DBAL\Driver\PDOException::("SQLSTATE[HY000] [2002] No such file or directory") /opt/lampp/htdocs/laravel/bagisto-master/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:31

2 PDOException::("SQLSTATE[HY000] [2002] No such file or directory") /opt/lampp/htdocs/laravel/bagisto-master/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:27

Please use the argument -v to see more details.

11 Aug
6 days ago

Randy_Johnson left a reply on Bagisto - Base Table Or View Not Found: 1146

I don't know. It just creates it all automatically. It's like going through WordPress install.

Randy_Johnson started a new conversation Bagisto - Base Table Or View Not Found: 1146

Illuminate \ Database \ QueryException (42S02) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'companyname.channels' doesn't exist (SQL: select * from channels limit 1) Previous exceptions

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'companyname.channels' doesn't exist (42S02)
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'companyname.channels' doesn't exist (42S02)

Hi, I have installed Bagisto and have managed to fix most of my problems, now I am stuck on this problem which has left me scratching my head since I am unsure if I am suppsed to create the table channels or such.

If anyone has any knowledge of this problem for Bagisto please let me know!

Randy_Johnson left a reply on Strange Things Happening With My Routes

I figured it out, I overwrote the home.blade.php, dunno why I never realized this before. Thanks for the help. I feel this post is no help for others, am I able to delete?

10 Aug
1 week ago

Randy_Johnson started a new conversation Strange Things Happening With My Routes

Route::get('/', '[email protected]'); Route::get('/about', '[email protected]'); Route::get('/contact', '[email protected]'); Auth::routes(); Route::get('/home', '[email protected]')->name('home');

As you can see with my routes I have '/' as the page controller home, but after just recently using the command to create the auth - php artisan make:auth the '/' is never called and I am sent to the net auth home page. I find this confusing because shouldn't I have to have /home within the url bar for it to be displayed, and why is this overwriting the original '/' pages controller home. Smells funky if you ask me.

Randy_Johnson started a new conversation Ecommerce With Auth Tutorials

Hi, can anyone recommend me any tutorials, my end goal is to create an e commerce site so I can start trading on it.

09 Aug
1 week ago

Randy_Johnson started a new conversation Setting FB Variables Int The .env

I am setting up fb login with socialite, I just came to a point which I ain't to sure about:

'facebook' => [
    'client_id'     => env('FB_CLIENT_ID'),
    'client_secret' => env('FB_CLIENT_SECRET'),
    'redirect'      => env('APP_URL') . '/facebook/callback',
],

with the env('var'_name'), do I set this inside the .env like such FB_CLIENT_ID = '342523tdgdrge'; or should I just set the variable inside the servies php file as such:

 'facebook' => [
    'client_id'     => 'dfasdfadfasdfasdfsdff',
    'client_secret' => 'fasdfsdafasdfasdfsdfsdf'
    'redirect'      => env('APP_URL') . '/facebook/callback',
],

Hope to hear from you soon.

19 Jun
1 year ago

Randy_Johnson started a new conversation Matching A User To His Post In Blade

Hello, In the code below I wish to add the user name to who ever created the post. Now would I be doing that by looping through each user to see if the user id of posts matches the user id of the user id of users and if so print out the name.

Or is there a better way of doing it?

Controller

    return view('posts.index')
        ->with('posts', $posts)
        ->with('users', $users);

=========================

View

@if(count($posts) > 0)
    @foreach($posts as $post)
        <div class='card' style="margin-bottom: 20px;">
            <div class="card">
                    <div class="card-body">
                        <a href="/posts/{{$post->id}}">{{$post->title}}</a> | {{$post->created_at}}
                    </div>
            </div>
        </div>
        @endforeach'

@else 
    <p>No post found</p>
@endif 

Regards

15 Jun
1 year ago

Randy_Johnson left a reply on Bash: Php: Command Not Found

Brilliant! Thanks very much

Randy_Johnson started a new conversation Bash: Php: Command Not Found

Hi guys, sorry for the bovva, but the story is that I just recently formatted my pc and pretty much just copied any pasted my project over to a usb from my htdocs and then copied them back over. To the htdocs from a fresh install.

I installed VSCode and Git and am using the gitbash command terminal inside vscode. The problem is that when I try to run an artsian command, specifically

php artisan mirgrate

I am getting the

bash: php: command not found error.

I installed composer etc think something may happen, I did happen to see something in the corner of vscode saying something about php not being linked but then I haven't seen it since I install composer.

Please help, Randy

14 Jun
1 year ago

Randy_Johnson left a reply on Phpmyadmin Issue!

Yup. Restarting my PC actually worked. Cheers dude. Sorry for the inconvenience.

Randy_Johnson started a new conversation Phpmyadmin Issue!

I recently just formatted my computer and reinstalled xampp. Inside the config file in phpmyadmin folder, I have set my username and password set to: root, password. When I go through the local host I get access denied.

On the control panel for xampp, next to MySQL, I click admin, and it takes me to the phpmyadmin page. I have allowed cookies within the config file so I see the page where I enter the username and password. I use the username and password of root, password and gain access.

I have no idea why I can gain access this way and not by going through the localhost. I probably should just ignore this but cannot, its bugging me wildly.

The only thing I can think of is that the first attempt has store the username and password somewhere whilst attempting to go through local host with the wrong username and password, and when going through localhost and then clicking phpmyadmin folder, that its grabbing these original wrong username and password. Maybe I don't know, please help.

13 Jun
1 year ago

Randy_Johnson left a reply on LocalHost Given Name Is No Longer Working

Please can I you delete this. Literally, after hours pouring over this, I sent this question, and immediately got it working.

Randy_Johnson started a new conversation LocalHost Given Name Is No Longer Working

In my hosts file I have

127.0.0.1 localhost 27.0.0.1 lsapp.test

and in my httpd-vhosts I have

<VirtualHost *:80> DocumentRoot "C:/xampp/htdocs/lsapp/public" ServerName lsapp.test

and it is no longer working, the weird thing is, is that it was working.

10 Jun
1 year ago

Randy_Johnson started a new conversation Miss Understanding About Eloquent

Am struggling to understand just how information is being pulled from the database using Eloquent. Here is my code:

Post controller

public function index() 
{
    $posts = Post::orderBy('created_at', 'desc')->get(); 
    return view('posts.index')->with('posts', $posts);
}

Post Model

class Post extends Model { // Table Name protected $table = 'posts';

// Primary Key
public $primaryKey = 'id';

// Timestamps
public $timestamps = true;

public function user()
{
    return $this->belongsTo('App\User');
}

}

There seems to be a magic box.

09 Jun
1 year ago

Randy_Johnson left a reply on Database Config.php Or .env

Perfect, Thank you very much.

08 Jun
1 year ago

Randy_Johnson left a reply on Database Config.php Or .env

Thank you all for your input. Each one of your inputs has taken me closer to full understanding of the subject. I think the next step is to just get it there and do it. Blessings

Randy_Johnson left a reply on Database Config.php Or .env

Can any one please link to me an article on the matter at hand?

Randy_Johnson left a reply on Database Config.php Or .env

So if I was to make the website public and private it to a host would I leave the access details in the .env or put them into the config.Php?

Randy_Johnson started a new conversation Database Config.php Or .env

Why do we put the connection string in the .env and not the config.php.

Regards, Laravel Newbie

06 Jun
1 year ago

Randy_Johnson started a new conversation Struggling To Understand Route Order, Please Help

public function show($id)
{
    $post = Post::find($id);
    return view('posts.show')->with('post', $post);
}

public function edit($id)
{
    $post = Post::find($id);
    return view('posts.edit')->with('post', $post);
}

I have a posts controller with some functions looking like so, but what it is I am struggling to understand is how in the url the edit function will be /posts/4/edit where the show will be shown just as /posts/4, what am struggling to understand is the why isn't it like so /posts/4/show?

Sorry for the silly question but I hope you are happy to help.

Regards