Daniel1836

Daniel1836

Member Since 5 Months Ago

Experience Points
13,110
Total
Experience

1,890 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
122
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 3
13,110 XP
Jul
09
3 weeks ago
Activity icon

Replied to Laravel - Trying To Use Cache

Anyone?

I don't think it's a complicated problem.

I'm trying to see if my thread updated time is greater than that in the cache, and if it is, show my front end in bold.

I think the problem lies in this line

$key = sprintf("users.%s.visits.%s", auth()->id(), $this->id);

I think he may have mentioned he was using Redis. (which I don't have installed)

So, basically it fetches that specific user's ID and check when it visits this instance.

Any alternative ways to implement this?

And Laravel is squawking when I mention cache.

Jul
08
4 weeks ago
Activity icon

Started a new Conversation Laravel - Trying To Use Cache

I'm creating the Forum App in the Laravel - Journeys section.

https://laracasts.com/series/lets-build-a-forum-with-laravel/episodes/48

Specifically, episode 48, where they are using the cache to see if new updates have been implemented. So that new posts can be displayed in bold.

The code in my model is this:

  public function hasUpdatesFor()
     {
         $key = sprintf("users.%s.visits.%s", auth()->id(), $this->id);
         return $this->updated_at > cache($key);
     }

The error I get when I refresh is this:

Call to undefined function App\cache()

For context, my front end code looks like this:

    @if ($thread->hasUpdatesFor(auth()->user()))
          <strong>
          {{ $thread->title }}
          </strong>
          
          @else 
          
           {{ $thread->title }}
           @endif
           

Now, is Jeff using something like Redis to implement this? (That I have not installed).

If so how do I install it? If not, what do you think is going wrong? Or preferably, is there a way to accomplish this without installing additional programs?

Thanks

Jul
07
4 weeks ago
Activity icon

Replied to Carbon Error (Data Missing)

I deleted the 'u' and it started working again.

Activity icon

Started a new Conversation Carbon Error (Data Missing)

On my Laravel app I get this error.

InvalidArgumentException in Carbon.php line 917:
Data missing

It should be a simple fix.

I have this code on my model file.

     public function getDateFormat()
{
     return 'Y-m-d H:i:s.u';
}

It was working before, it stopped working.

Jul
06
4 weeks ago
Activity icon

Started a new Conversation Issue With PHP Version And Laravel On Host Site.

I changed my PHP version on my host site, now my Laravel projects stopped working. I changed it back and it still doesn't work. I am using Host gator.

It was working right before.

Does anyone have any knowledge on what can be done to fix this? I know the problem is because of the PHP version change.

The error I get it this

Fatal error: Call to undefined function Symfony\Polyfill\Mbstring\iconv_strpos() in /home4/danielklein/laravel/vendor/symfony/polyfill-mbstring/Mbstring.php on line 501

I find it odd that it mentions Symfony because I don't believe that is related to Laravel.

Perhaps something is wrong in my htaccess?

Thanks,

I'm pretty desperate to fix this.

Jul
02
1 month ago
Activity icon

Started a new Conversation How To Install Vue In My Laravel App On My Shared Host Site

How would I go about installing Vue?

Would it suffice to include the

 <script src="https://cdn.jsdelivr.net/npm/vue"></script>

tag on my files?

Or do I need to install via the command line?

Jun
18
1 month ago
Activity icon

Replied to Installing Laravel On Shared Hosting

Apparently Symfony will only run on PHP 7.2 or greater. That is my problem. (I'm currently using 7.1)

This is maybe a dumb question, but it is important to me not to mess up my current Laravel projects. My Laravel version is 5.2.45 and for some reason my Laravel projects stop working when I switch to PHP 7.2.

Will my Laravel projects still work if I upgrade my Laravel version to 5.4? And How do I go about upgrading my Laravel version?

Thanks

Jun
10
1 month ago
Activity icon

Started a new Conversation My Portfolio - As A Junior PHP Developer

I figured I'd post my portfolio to see what the Laracast community thought of it.

www.danielklein18.com

I am newly employed as a junior PHP developer, but it never hurts to keep improving your portfolio.

I am open to design/flow critiques.

But I am more looking for advice on my projects based on how they relate to what employers are looking for with regard to PHP development.

I have 2 web design projects since some employers are looking for full stack. A PHP section, with Laravel and procedural PHP with databases. And a JavaScript section showing a little Ajax, jQuery, angular and what I had learned in school. Not sure how relevant this section is though. (besides AJAX)

So I'd appreciate some input. And hopefully you can point out things I've never even thought of.

Thanks

Jun
09
1 month ago
Activity icon

Replied to Installing Laravel On Shared Hosting

Ok. Which Symfony forum do you suggest?

Activity icon

Replied to Installing Laravel On Shared Hosting

Symfony.

I'm kind of confused right now. I'll probably figure it out eventually.

The message I got at first was composer.lock needs to be php 7.2 (current version was 7.1).

After upgrading to php 7.2 the message I get now is 500 error (undefined function), except the screen has the Symfony logo on it with links to the documentation and stuff , which gives me encouragement that I'm on the right track.

Activity icon

Replied to Installing Laravel On Shared Hosting

Supposing I have all the files in the right place, and assuming my configuration was done correctly, and I still encounter a HTTP 500 error message on my route what could potentially be the problem?

Just trying to narrow down my troubleshooting.

Jun
06
1 month ago
Activity icon

Replied to Installing Laravel On Shared Hosting

This is the entire contents of the Symfony index.php file.

<?php
header("refresh: 5; https://mysite/Symfony/public/index.php");

	echo '<title>Symfony Installed</title><div style="background: #e9ffed; border: 1px solid #b0dab7; padding: 15px;" align="center" >
	<font size="5" color="#182e7a">Symfony is installed successfully.</font><br /><br />
	<font size="4">Symfony is a Framework and doesn\'t have an index page.<br /><br />
	You will be redirected to its "public" folder in 5 seconds...<br /><br />
	Symfony aims to speed up the creation and maintenance of web applications, and to replace the repetitive coding tasks by power, control and pleasure.

Symfony is aimed at building robust applications in an enterprise context. This means that you have full control over the configuration: from the directory structure to the foreign libraries, almost everything can be customized. </font></div>';
?>

So I do not see where to configure it like in the Laravel index.php file.

Activity icon

Replied to Installing Laravel On Shared Hosting

Sorry for the confusion. I meant Laravel is working. Symfony is not.

Activity icon

Replied to Installing Laravel On Shared Hosting

Ok, so for my Laravel projects the index.php file is located directly in public_html.

But if I understand that article you posted, I can put the Symfony index.php file in a sub folder inside public_html and that will work as well.

My next question for my Symfony index.php file I do not see anything like this.

require __DIR__.'/../../dj3core/bootstrap/autoload.php';

I only see this.

<?php
header("refresh: 5; https://mysite/Symfony/public/index.php");

How would I go about configuring it?

Activity icon

Replied to Yii Framework - Access Denied For MYSQL

I solved this one thanks

Activity icon

Replied to Installing Laravel On Shared Hosting

I'm still working on it.

I don't need any advice on images.

I just need that index.php file in the public_html directory with the required path pointing to my Symfony project files.

But like I said I already have an index.php for my Laravel projects. Is there a way to rename index.php ('index1.php') and then make some configuration that points to it? That way I won't have to overwrite it.

Jun
05
2 months ago
Activity icon

Started a new Conversation Installing Laravel On Shared Hosting

I actually have Laravel installed. I'm trying to install Symfony as well for my portfolio.

The problem is this; The Symfony Project files are located one directory up from public_html, and I understand the index.php file must be inside public_html.

But I already have a index.php from my Laravel projects, and if I replace it my Laravel projects will stop working.

I think I need an alias pointer.

But I'm unclear how to proceed for both frameworks to coexist on my site.

Can anyone help?

Thanks

Apr
22
3 months ago
Activity icon

Started a new Conversation Running Npm Install Using Laravel (Installing Vue)

I'm trying to use Vue in my Laravel project.

I need to add the required dependencies in my package.json file, as well as the javascript files in my assets folder.

I installed node in my Laravel root folder and typed npm install, but the dependencies and files did not appear.

I have never used Vue before.

Are there certain steps I need to take to install Vue?

(Basically lesson 29, in the "Build a Forum App" in the Laravel Series)

Apr
14
3 months ago
Activity icon

Started a new Conversation Yii Framework - Access Denied For MYSQL

I don't know if it's appropriate to ask questions on the PHP framework Yii.

But I figure this is analogous to Laravel and there should be a pretty simple solution.

I get this error when I try to create a table in the terminal.


Exception 'yii\db\Exception' with message 'SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)'

The db file reads like this

return [
    'class' => 'yii\db\Connection',
    'dsn' => 'mysql:host=localhost;dbname=yii2basic',
    'username' => 'root',
    'password' => '',
    'charset' => 'utf8',

I don't know why I don't have access with both root and no password.

Thanks

Apr
09
3 months ago
Activity icon

Replied to Dropdown Not Updating On Front End When I Update Database

I solved it by using

@foreach (App\Channel::all() as $channel) instead.

I hope nothing else blows up by doing this.

Activity icon

Replied to Dropdown Not Updating On Front End When I Update Database

The functionality of my app is working properly. However the list in the dropdown menu in my browser reflecting the values in my database from the {{ $channel->name}} part of my code is still displaying the old values, not the new ones I changed in my table in MYSQL

Activity icon

Started a new Conversation Dropdown Not Updating On Front End When I Update Database

As the title says, I updated the 'name' column in my database in PHPmyadmin manually to something different.


@foreach ($channels as $channel)
                      <option value="{{ $channel->id}}" {{old('channel_id')==$channel->id? 'selected' : ''}}>{{ $channel->name}}</option>
                                           @endforeach

But when I see the dropdown on my browser, it is displaying the old values not the new ones.

Anyone know why this is?

Thanks

Apr
07
3 months ago
Activity icon

Replied to Laravel Route Question

Thank you

Activity icon

Started a new Conversation Laravel Route Question

I'm trying to get this code snippet to work.

a href="{{ route('profile', Auth::user()) }}">My Profile</a

It says route not defined.

My web.php route looks like this

Route::get('/profiles/{user}', '[email protected]');

I am not sure if this route is what I should be troubleshooting or if there is a file elsewhere, as I am quite new to Laravel.

I am following a tutorial step by step,I'm not sure where I'm tripping up.

Everything else in the Controller, View, Route is working for this, it just errors when I try the first bit of code I mentioned.

Also, is there any way I can use URL instead of route, then pass the authenticated user? If the URL is http://mysite.com/profile/{user}

(excuse that I did not close the a tag, the forum actually did my html in the browser)

Thanks

Apr
01
4 months ago
Activity icon

Replied to These Credentials Do Not Match Our Records. (Log In) (Laravel)

Not working yet.

I have also tried pulling in different stuff in various files, like (use App\Models\User;)

Activity icon

Replied to These Credentials Do Not Match Our Records. (Log In) (Laravel)

I'm not 100% sure this the correct code snippet. It is from (RegisterController.php)

protected function create(array $data) { return User::create([ 'name' => $data['name'], 'email' => $data['email'], 'password' => Hash::make($data['password']), ]); }

Activity icon

Replied to These Credentials Do Not Match Our Records. (Log In) (Laravel)

They are both being stored in the database. The email appears correct, the password is being hashed in the database so I can't verify that they are a match.

From what I found on google one person recommended (bcrypt password) Checking all the relevant php files I don't think so, it is being hashed.

Activity icon

Replied to These Credentials Do Not Match Our Records. (Log In) (Laravel)

No. Then it says (These credentials do not match our records.) in red. It asks for the email and the password.

Activity icon

Replied to These Credentials Do Not Match Our Records. (Log In) (Laravel)

version 5.2.45

Technically registering automatically logs you in. But I want to be able to log in using credentials after logging out.

Activity icon

Started a new Conversation These Credentials Do Not Match Our Records. (Log In) (Laravel)

Hi,

I am building the Forum app listed in the Laracasts Series (Laravel) on this site.

I can register fine, but the login section I get the error (These credentials do not match our records.) even though the (email etc) information is inside my users table in the database.

The files I am using are the standard boiler plate I get from using the (php artisan make:auth) command.

Does anyone know a solution?

I suspect from my research the password is suspect. (it is being hashed).

Thanks

Mar
31
4 months ago
Activity icon

Replied to How Can I Use The Terminal/tinker Using Laravel On Hostgator?

Thanks for the reply.

I'm able to connect the ssh to my shared hosting site.

When I run the php artisan command though I get this message.

(Could not open input file: artisan)

Activity icon

Started a new Conversation How Can I Use The Terminal/tinker Using Laravel On Hostgator?

I'm building a project using Laravel on HostGator. I'm trying to create a factory to create some dummy data. Is there a way to use the terminal to enter tinker/php artisan commands on HostGator?

I've been creating the files (models, controllers) manually in my cpanel up to this point.

Thanks

Mar
26
4 months ago
Activity icon

Started a new Conversation Trouble Connecting To Database Using Laravel On Host Gator

This is the error I get.

Access denied for user 'root'@'localhost' (using password: NO)

I am trying to mess with my .env file. Here is what I have.

DB_CONNECTION=mysql DB_HOST=localhost DB_PORT=3306 DB_DATABASE=laravel DB_USERNAME=root DB_PASSWORD=

I have tried creating a user and password and giving privileges for the database and entering it in the .env, but that didn't work.

Thanks

Mar
04
5 months ago
Activity icon

Replied to How Can I Run Laravel In Host Gator?

I have 5.5.37. Will that work?

Activity icon

Started a new Conversation How Can I Run Laravel In Host Gator?

I can run Laravel projects in the browser from my local machine. I uploaded and installed my Laravel project files into my file manager on Host gator in the appropriate places (According to this site referred by technical support) (https://laravel.io/forum/02-13-2014-how-to-install-laravel-on-a-hostgator-shared-server), but the Laravel welcome page won't work. Not sure about the url path to access it either. I am able to run vanilla PHP and connect it to the host gator php my admin database though. That works. Can anyone help on the steps?