floweringmind

floweringmind

Member Since 4 Years Ago

Experience Points 2,710
Experience Level 1

2,290 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 38
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]aracasts.com 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.

27 Jun
1 month ago

floweringmind left a reply on Socialite Github Login Giving 404

Figured it out. You need to change env('data') to 'data'. like so:

'github' => [
'client_id' => 'client_id',
'client_secret' => 'client_secret',
'redirect' => 'https://domain.com/callback/github',
],

floweringmind left a reply on Socialite Github Login Giving 404

I made the following modification which fixed the issue, but that is really a hack. Not sure why the service.php is not being read correctly.

protected function createGithubDriver()
{
    $config = $this->app['config']['services.github'];
    $config['client_id'] = 'client_id';
    $config['client_secret'] = 'client_secret';
    $config['redirect'] = 'https://domain.com/callback/github';
    //dd($config);
    return $this->buildProvider(
        GithubProvider::class, $config
    );
}

floweringmind left a reply on Socialite Github Login Giving 404

Finally figured out that this file:

vendor/laravel/socialite/src/SocialiteManager.php

gets the 3rd party services auth info. In my case I added error checking into createGithubDriver method and that informed me that the 3rd party data was null. Still not sure why this: $this->app['config']['services.github']; is null.

array:3 [ "client_id" => null "client_secret" => null "redirect" => null ]

26 Jun
1 month ago

floweringmind started a new conversation Socialite Github Login Giving 404

I am using Socialite. When I use the command:

Socialite::driver($provider)->redirect();

The user goes to Github but I get a 404 page on Github. I have this code in my services.php

'github' => [
'client_id' => env('client_id'),
'client_secret' => env('client_secret'),
'redirect' => env('https://domain.com/callback/github'),
],

How can I check if that info is being sent to Github?

17 Jun
2 months ago

floweringmind left a reply on Change Display Of Fields Preview

Figured it out: ->hideFromIndex()

floweringmind started a new conversation Change Display Of Fields Preview

I am have created a table that I am editing through Nova. I can edit just fine and have added the Trumbowyg so I can edit HTML. Yet when I save and it shows the preview of columns for that table. It displays raw html code. What do I need to modify to be able to edit that column and not show or show that column as HTML?

25 May
2 months ago

floweringmind left a reply on Call To A Member Function Has() On String

@SNAPEY - I finally tracked down the issue to actually using errors in a session like so:

session(['errors' => 'The form has expired due to inactivity. Please try again']);

Thank you.

24 May
2 months ago

floweringmind started a new conversation Call To A Member Function Has() On String

I am trying to debug why I am getting this error: "Call to a member function has() on string"

I will be going from page to page and then the site breaks with the above error.

I appear to be redirected to the register page and this code: @if ($errors->has('email')) is having problems. If I try to go to another page I end up having the same error.

The only way I can temporarily resolve this is to clear the cookie. But then a couple of minutes later it happens again.

Appears to be related to renaming a model and Laravel caching the old name. I renamed use App\Viewprofilepics; to use App\Viewprofiles;

Anyway I commented out the model in my controller and then things started working. Then I added it back in and everything is fine now.

By the way I did clear all the caches and my browser cache and nothing fixed the problem until I commented out the model. Bizarre.

19 May
3 months ago

floweringmind left a reply on Session Timeout Is Always 2 Hours

@TISUCHI - It worked and I gave you best answer.

floweringmind left a reply on Session Timeout Is Always 2 Hours

Looks like changing the .env worked.

floweringmind left a reply on Session Timeout Is Always 2 Hours

@TISUCHI - As I said above, I changed that to 'lifetime' => env('SESSION_LIFETIME', 30), and Laravel is still setting my cookies at 2 hours.

floweringmind started a new conversation Session Timeout Is Always 2 Hours

I have modified my php.ini to be 30 and my Laravel config/sessions to be 30, which I figured is 1 minute.

Yet every time I log into my site the cookie is set for 2 hours. Is there somewhere else that the session is being set?

floweringmind started a new conversation Logged Out User But Cached Content?

I keep running into an issue where I don't realize I am logged out and end up reloading a page I was working on that gave me a 404. I spent 30 minutes trying to figure out why a route wasn't working because I was logged out but the page was cached.

Is there anyway to have Laravel force a cache clearing, logout the user and tell the browser to clear it's cache?

25 Apr
3 months ago
20 Apr
3 months ago

floweringmind started a new conversation Don't Understand The Laravel Filesystem

Can someone explain why there is a PUBLIC directory where files are compiled such as CSS and JS. Then there is a STORAGE directory and you have to create a link between public and storage.

Why isn't everything in STORAGE or PUBLIC instead of this weird confusing layout?

I try: use Illuminate\Support\Facades\Storage; as the docs suggest but I can't access the PUBLIC directory.

If I create a link to public I get an error saying there is no support for symbolic link directories.

So if I want to access the files in public it appears that I have to use regular PHP file calls.

I want to do things the correct Lavarel way, but this just doesn't make sense to me.

19 Apr
4 months ago

floweringmind left a reply on Trying To Get Distances Between Two Geocode Points

Thanks, by reading through that thread I figured out my problem and this code works:

$result = DB::table('profiles')
->select('id', DB::raw('(3959 * acos (cos ( radians(39.6675) ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(-105.067) ) + sin ( radians(39.6675) ) * sin( radians( lat ) ) ) ) as distance'))
->having('distance', '<', 66)
->orderBy('distance', 'ASC')
->limit(20)
->get();

floweringmind started a new conversation Trying To Get Distances Between Two Geocode Points

I am trying to compare one user's Latitude and Longitude against the rest of the users in my database table profiles.

This SQL works:

    SELECT
        id, (
          3959 * acos (
          cos ( radians(39.6675) )
          * cos( radians( lat ) )
          * cos( radians( lng ) - radians(-105.067) )
          + sin ( radians(39.6675) )
          * sin( radians( lat ) )
        )
    ) AS distance
    FROM profiles
    HAVING distance < 66
    ORDER BY distance
    LIMIT 0 , 20;

But when I try to convert it over I get an error: syntax error, unexpected ';', expecting ',' or ')'

$result = DB::table('profiles') ->select('id', DB::raw('( 3959 * acos ( cos ( radians(39.6675) ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(-105.067) ) + sin ( radians(39.6675) ) * sin( radians( lat ) ) )) as distance') ->having('distance', '<', 66) ->orderBy('distance', 'DESC') ->limit(20) ->get();

02 Apr
4 months ago

floweringmind left a reply on Getting Data From A Different Table Than The Controller?

Figured it out:

use Auth; $user_id = Auth::user()->id;

floweringmind started a new conversation Getting Data From A Different Table Than The Controller?

I am using Nova and have created a user account. I am in my profile controller and want to get the user account ID.

On the front-end I can get the user id with: {{Auth::user()->name}} I tried doing that in my profile controller, but it doesn't work. $user_id = Auth::user()->name;

Can someone explain how I would do this?

11 Jun
4 years ago

floweringmind started a new conversation Understanding Routes And Public On A Live Server?

Ok I have a regular Debian Linux box, installed Composer and Laravel. I am finding issue with the routes and want to know best practice. Because I know enough that I could hack the system into doing whatever I wanted.

I have Laravel installed in a sub-directory on the domain. My sub-directory is test and this gets me: domain.com/test/public/route-name I would like to remove public and would in most cases just modify a .htaccess to do this and get domain.com/test/route-name

I was also under the impression you could change public to the name of your project, but not sure about that.

Thanks!

Chris