Jaytee

at Student at Ara Institute

Experience

74,285

78 Best Reply Awards

  • Member Since 1 Year Ago
  • 324 Lessons Completed
  • 1 Favorite

20th August, 2017

Jaytee left a reply on Auth Facade Breaking Views In PHP 7.1.7? • 47 minutes ago

Let's clean that view up anyway. If the user isn't logged in, then they shouldn't even have a notifications dropdown.

So, wrap all of that dropdown between an if statement to check whether a user is signed in. Then you don't need to check whether they're authenticated for the classes etc.

Jaytee left a reply on Laravel 5.4 Update Method Code • 52 minutes ago

I think you need to learn Laravel first before jumping into it.

If you had learned Laravel, you would know about this. Go watch the free series.

19th August, 2017

Jaytee left a reply on Still Getting Old Whoops On Upgrade From 5.4 To 5.5 • 19 hours ago

Exactly, so check Github to see if Whoops has officially been removed from Laravel or not.

As for the documentation, it's likely not feature-complete since 5.5 isn't officially released. When 5.5 is officially released, you'll see a complete documentation.

It's not a big deal whether you have Whoops or not.

Jaytee left a reply on Still Getting Old Whoops On Upgrade From 5.4 To 5.5 • 19 hours ago

Exactly, so check Github to see if Whoops has officially been removed from Laravel or not.

As for the documentation, it's likely not feature-complete since 5.5 isn't officially released. When 5.5 is officially released, you'll see a complete documentation.

It's not a big deal whether you have Whoops or not.

Jaytee left a reply on A Site Of All Laravel,Eloquent Models/functions • 20 hours ago

Lmao I was just on the website i think you're talking about the other day. Unfortunately I can't remember the name.

I'll scan through my history and see if i find it.

Jaytee left a reply on Still Getting Old Whoops On Upgrade From 5.4 To 5.5 • 20 hours ago

Yeah I have the old whoops aswell, nothing to worry about.

Check Github to see if it's been removed or not. Problem solved.

17th August, 2017

Jaytee left a reply on Getting Paginator Pages - Am I Doing The Right Thing? • 2 days ago

There are a few options you can handle this:

  1. Stick with Product::paginate(10); and just start from page 1. If you need to navigate to page 3, just click the number '3'
  1. Stick with what you have got, since the current page is the last parameter, you really can't do anything about it

  2. Change the URL of your link to have ?page=3 at the end.

13th August, 2017

Jaytee left a reply on Count And Where • 6 days ago

So what do you want to achieve here?

The total count of users in your system or the total amount of times a particular user has registered?

Jaytee left a reply on A Clean Way For Users To Opt Out Of Emails • 6 days ago

Why don't both of you @god and @bensampo Just create a wrapper around the Mail class and use that?

That way, it's hardcoded to only send to users who have enabled emails/notifications

Jaytee left a reply on Ads Make Site Slow • 6 days ago

@d_dub Bye

Jaytee left a reply on Multiple Methods In Web Routes • 6 days ago

@m7vm7v It's fairly obvious.

OP is using two routes to the same URI but different controller methods. As you'd expect, it isn't working.

Jaytee left a reply on A Clean Way For Users To Opt Out Of Emails • 6 days ago

Haha, i was just about to comment the same thing as @IgorBabko .

The same thing applies with Mail::to($users)

Just do a query to get the users that are opted in, and then send the mail.

Jaytee left a reply on Multiple Methods In Web Routes • 6 days ago

Well, to put it straight. You can't have the same route, otherwise like you said, overwriting is going to occur.

You'll either need to prefix those routes or in the controller method, determine what view should be displayed back.

12th August, 2017

Jaytee left a reply on Method 'to' Not Found In \Illuminate\Support\Facades\Mail • 1 week ago

Try just dumping the autoload composer dump-autoload

Sometimes in fresh applications, some things just dont work for reasons unknown. If your app is new, you can always just create a new app

11th August, 2017

Jaytee left a reply on Why Laravel Dropped Elixir? Why Forcing Vue.js? What Is It That You Are Trying To Fix? • 1 week ago

@antracks No you don't get any credit. No one else takes credit when they contribute or suggest an idea. It was hardly a problem solver.

It's not hard to add React or any other JS framework to your application.

Jaytee left a reply on Can't Update A Resource, NotFoundHttpException • 1 week ago

Pretty sure the resource method uses Route Model Binding so instead of accepting the $id you would need to accept Event $event

Jaytee left a reply on Best Practice For Controllers • 1 week ago

I usually have a separate directory for my dashboard/administration with the same controller name.

app
    http
        controllers
            Admin
                PostController // the one that admins use
            PostController // the one that users use
            

Jaytee left a reply on Storing Array Into HTTP Session • 1 week ago

session([
    'cart_item' => [
        'box' => [
            'quantity' => 1,
            'price' => 49.90
        ]
    ]
]);

to get it from the session:

session('cart_item'); // i'm pretty sure this retrieves
session()->get('cart_item');

10th August, 2017

Jaytee left a reply on "block" Database Items For N Minutes • 1 week ago

Well you could have a locked_at field in your database table alongside a cron job that runs every minute to check if locked_at is equal to or greater than 3 minutes, if it is, unlock it (i.e: set locked_at to null)

Jaytee left a reply on Using A WYSIWYG Editor With Webpack • 1 week ago

Yeah what @ejdelmonico said. There's very few pages that require textual inputs, so it's best to extract it to a partial and include it when needed.

Not everything needs to be compiled into a file.

Jaytee left a reply on How Many Of You Are Agree With The Idea That We Need Laracast Mobile App ? • 1 week ago

@martinbean Rumour has it, it's the best way to learn ;)

Nah for real tho, some things just aren't meant to have a mobile app. You dont code on a phone, so you wouldn't watch casts on a phone

Jaytee left a reply on How To Insert Multiple Checkbox In Laravel 5.4 ??? • 1 week ago

Ever heard of a loop? Thats standard PHP stuff, not laravel related.

Jaytee left a reply on Npm Run Dev Error With LESS • 1 week ago

Installing Yarn globally is more of value than installing it for just one project. And, the likelihood of OP having just one project is low.

  • Yarn in my opinion, is faster and less strict (which has it's pros)

Jaytee left a reply on Composer.json Says 5.4.*(did An Update) And My Artisan Says I Am Using 5.3.31 • 1 week ago

It could just be a cache error or a bug. Try removing your vendor directory and running composer install again.

Alternatively, run composer dump-autoload and restart your terminal.

Jaytee left a reply on Vue Select Get Request Help • 1 week ago

You won't be able to redirect in PHP since it's an Ajax request. You'll need to redirect in Javascript within your callback on the promise.

axios.post('api/v1/categories/post', this.options)
    .then(() => {
        window.location.href = "some url here";
    });

Jaytee left a reply on Npm Run Dev Error With LESS • 1 week ago

Add yarn globally, not like what the user above said

npm install -g yarn

Jaytee left a reply on Whats Wrong With This Relationship? Goddammmmiit • 1 week ago

@rumm.an You are correct, it does return an instance of the relationship, but it's also a query builder instance.

Check out the documentation here:

https://laravel.com/docs/5.4/eloquent-relationships#relationship-methods-vs-dynamic-properties

9th August, 2017

Jaytee left a reply on Whats Wrong With This Relationship? Goddammmmiit • 1 week ago

You want to call the relationship as a property not a method.

$emails->first()->user. Calling it as a method will return an instance of the Query builder.

Jaytee left a reply on Looking For Some Advice And Best Practice Input On How I Should Structure A User Reports System For A Forum Project • 1 week ago

You could use a polymorphic relationship which essentially stores the name of the model in the database (App\Comment or App\Post) and an id for that model.

That way, in the future, if you integrate something else (as a silly example: Article) then it will pretty much work out of the box.

I always find that separating tables to make things clearer is better, but in this case, a polymorphic relationship will suffice.

Jaytee left a reply on Npm Install Hang • 1 week ago

I did a little more research on the fsevents error. It's quite common, so i wouldn't worry about it as i believe your dependencies don't rely on this.

I've made the switch to yarn now anyway, so you may aswell. It still does the same as NPM but i find it a little faster and in this case, less strict.

Best of luck.

Jaytee left a reply on Npm Install Hang • 1 week ago

It probably won't make a difference but try installing with yarn.

I read somewhere about installing Grunt helped fix an issue similar to this.

sudo npm install -g grunt

Let me know how any of these go.

21st July, 2017

Jaytee left a reply on ErrorException In PostController.php Line 105: Missing Argument 1 For App\Http\Controllers\PostController::show() • 4 weeks ago

Your route needs to take the shape of a wildcard like this:

Route::get('applicationForm/{id}', [email protected]');

Notice the {id}.

19th July, 2017

Jaytee left a reply on Laravel 5.3 Cancel Not Working • 1 month ago

pass the $subscription->stripe_plan instead.

Yep that's a bit weird as the cancel method is on the Subscription class. Are you sure you're using the Laravel\Cashier\Billable trait ?

You could remove and re-install cashier and see if that fixes the problem.

Jaytee left a reply on Access Last_activity On Session • 1 month ago

Are you actually using the Database to store sessions? If not then you can't.

Otherwise, you could just query the database. See the Laravel documentation.

4th July, 2017

Jaytee left a reply on The Content Did Not Appear On My Page • 1 month ago

Have you actually yielded the content section in your master template? Or visited the correct route?

28th June, 2017

Jaytee left a reply on Make And Get Cookies • 1 month ago

Really dude? @jeffz2016 this was 2 years ago ffs.

20th June, 2017

Jaytee left a reply on Are You All Using Vagrant ? • 1 month ago

Well..... I honestly haven't touched a VM for some months now. I've just used Valet as it suits my requirements.

12th June, 2017

Jaytee left a reply on Auth()->attempt(request(), $remember) • 2 months ago

This is from the documentation:

If you would like to provide "remember me" functionality in your application, you may pass a boolean value as the second argument to the attempt method, which will keep the user authenticated indefinitely, or until they manually logout. Of course, your users table must include the string remember_token column, which will be used to store the "remember me" token.

Now, notice how it states 'indefinitely'. If the second argument for attempt() is false, then I believe it defaults to the configuration files (see: config/session).

You'll see two options in config/session.

'lifetime' => 120 // 2 hours,
'expire_on_close' => false // dont delete session on browser close.

7th June, 2017

Jaytee left a reply on 403 Error Forbidden Path Laravel Homestead 2.0 • 2 months ago

Uhh the app_path will go to /my/root/folder

Check the docs here: https://laravel.com/docs/master/helpers#method-app-path

you can use public_path or asset and they'll take you to the public directory.

5th June, 2017

Jaytee left a reply on Trying To Make Use Of The Laravel Installer • 2 months ago

@lifesound Open a new thread next time.

You'll need to add it to your .zshrc file to persist it

Jaytee left a reply on 403 Error Forbidden Path Laravel Homestead 2.0 • 2 months ago

It'll be a permission issue. The app folder is meant to be secure right, since it houses your application code.

You can use the public directory for your assets, that's why the directory exists.

25th May, 2017

Jaytee left a reply on I Am Getting "This Page Isn’t Working. Localhost Is Currently Unable To Handle This Request. HTTP ERROR 500" • 2 months ago

Check that an infinite loop isn't occurring in all of the files relating to the route. I'm pretty sure I had this same error a while back as I was looping indefinitely.

24th May, 2017

Jaytee left a reply on Compatibility With IE11 Or Other Mobile Browsers. • 2 months ago

all Internet Explorer versions don't fully support flex. You can use a great website called: caniuse.com.

19th May, 2017

Jaytee left a reply on Parse Error • 3 months ago

Don't use route() when calling a method on a controller. Use action()

18th May, 2017

Jaytee left a reply on Properly Store Something In The DB • 3 months ago

It's personal preference. The helper is still doing the same behind the scenes :)

As for validating, you can do something like this on the Controller:

$this->validate($request, [
    // validation rules here
]);

// or using the helper function

$this->validate(request(), [
    // validation rules here
]);

Helpers are great since you don't need to import any classes. They're also cleaner too and often allow you to pass arguments without needing to chain additional methods.

In your text editor, you can search up the helpers.php file. The directory is Illuminate\Foundation

Jaytee started a new conversation Notifications Bar Doesn't Stay Toggled • 3 months ago

Ohhhhhhhh Jeffreyyyyy,

Quick and easy.

Steps to reproduce:

  • Open notifications sidebar
  • Close notifications sidebar
  • Open notifications sidebar again

Using Chrome version: 58.0.3029.110

You'll notice that the sidebar doesn't stay toggled.

17th May, 2017

Jaytee left a reply on Code Inside Event Listener Not Working • 3 months ago

Check the EventServiceProvider.

You should have an array similar to this:

protected $listen = [
        'App\Events\MyAwesomeEvent' => [
            'App\Listeners\MyAwesomeListener',
        ],
];

Jaytee left a reply on Properly Store Something In The DB • 3 months ago

You can use the request that is injected into the method or you can use the global helper function request(). If you use the helper function, you don't need to inject the request into the method.

There are numerous ways you can request data with both methods also, here's some:

$request->input('name')
$request->name
request('name')
request()->name
request()->input('name')

16th May, 2017

Jaytee left a reply on Lets-Build-a-Forum-in-Laravel - Lesson 38 - Pagination Issue • 3 months ago

I haven't watched the lesson but if you could post the code so others can review it and try and help you, that would be good.

In the meantime, check up on the nginx issue as the latest versions of Valet do use Nginx now.

Jaytee left a reply on How To Build A Similar Site? • 3 months ago

What you want is a thing that we refer to as a 'Lightbox'.

I won't list any lightbox's here, but a quick google search will find what you're looking for and from there, you can evaluate the one that fits your needs.

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.