jrock2004

jrock2004

Member Since 5 Years Ago

Experience Points
2,380
Total
Experience

2,620 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
32
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.

Level 1
2,380 XP
Mar
23
2 years ago
Activity icon

Replied to Syntax Error Or Access Violation

Would would I need to group? You do not need for that for SQL

Activity icon

Started a new conversation Syntax Error Or Access Violation

Trying to get some data for a dashboard page I am building. I am not sure why I am getting this error

$appData = App::orderBy('id', 'desc');                                                                                                                          
$appCount = $appData->count();                                                                                                                                  
$appTops = $appData->take(2)->get();                                                                                                                            
$providerData = Provider::orderBy('id', 'desc');                                                                                                                
$providerCount = $providerData->count();                                                                                                                        
$providerTops = $providerData->take(2)->get();                                                                                                                  
$showData = Show::orderBy('id', 'desc');                                                                                                                        
$showCount = $showData->count();                                                                                                                                
$showTops = $showData->take(2)->get();                                                                                                                          
                                                                                                                                                                          
return view('admin.index', compact(                                                                                                                             
    'appCount',                                                                                                                                                 
    'appTops',                                                                                                                                                  
    'providerCount',                                                                                                                                            
    'providerTops',                                                                                                                                             
    'showCount',              
    'showTops'
));

Here is the error I am getting

SQLSTATE[42000]: Syntax error or access violation: 1140 Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause (SQL: select count(*) as aggregate from `apps` order by `id` desc)
Mar
22
2 years ago
Activity icon

Replied to Upload Project Laravel

I really wish this was told in the beginning of downloading the project of website. Not every company I work with does VPS

Mar
20
2 years ago
Activity icon

Replied to Routes File Redirect

Mods, please delete. I forgot to add return in front of redirect

Activity icon

Started a new conversation Routes File Redirect

I am trying to figure out in the routes file how I can redirect based based off an if statement

// Auth Routes
Auth::routes();

if (!env('ALLOW_REGISTRATION', false)) {
    Route::any('/register', function() {
        redirect('/home/index');
    });
}

// Home Controller
Route::get('/', '[email protected]');

Right now what happens is I get a blank page. Maybe I should just 404 since I am trying to hide that route?

Activity icon

Replied to AppServiceProvider Giving Me Non-object

Thank you all guys. Still learning Laravel and now I know where to look

Activity icon

Replied to AppServiceProvider Giving Me Non-object

I figured it out. @Snapey got me looking and the compiled files. The problem was the else statement was being fired because of this code change causing the else to be rendered. The else code is expecting the user to be logged in

Activity icon

Replied to AppServiceProvider Giving Me Non-object

@Snapey

This is line 49

<?php echo e(Auth::user()->name); ?> <span class="caret"></span>

Here is the file uncompiled

{{ Auth::user()->name }} <span class="caret"></span>
Activity icon

Replied to AppServiceProvider Giving Me Non-object

@Snapey Looking at those line I am not understanding the filename in 087bb77ee1021a12882b9d85d430c19f0d6eafd5.php line 49 There is no such file

Activity icon

Replied to AppServiceProvider Giving Me Non-object

@vipin93 How would this help me for sending a variable to a layout?

Activity icon

Replied to AppServiceProvider Giving Me Non-object

@SaeedPrez Nope, still same result

Mar
19
2 years ago
Activity icon

Replied to AppServiceProvider Giving Me Non-object

@SaeedPrez The code will work if I take out the && $isUserRegEnabled. I took a screenshot and posted link in OP. I even too the config part out of the AppServiceProvider and I still get the error

Activity icon

Replied to AppServiceProvider Giving Me Non-object

I have updated the question with more information to help

Mar
18
2 years ago
Activity icon

Started a new conversation AppServiceProvider Giving Me Non-object

I am trying to add a variable to the AppServiceProvider to pass to the view and I am getting the error of Trying to get property of non-object.

public function boot()
{
    view()->composer('shared.nav', function($view)
    {
        $view->with('isUserRegEnabled', config('app.ALLOW_REGISTRATION', false));
    });
}

If I var_dump the config here, its return me a boolean of FALSE. Not sure what I am doing wrong

Here is how I am using it in my layout file

@if (Auth::guest() && $isUserRegEnabled == true)
    ....
@endif

Maybe I cannot do it this way?

Here is the first full stack:

in 087bb77ee1021a12882b9d85d430c19f0d6eafd5.php line 49
at HandleExceptions->handleError('8', 'Trying to get property of non-object', '/home/jcostanzo/Development/AndroidAppAddicts/storage/framework/views/087bb77ee1021a12882b9d85d430c19f0d6eafd5.php', '49', array('__path' => '/home/jcostanzo/Development/AndroidAppAddicts/storage/framework/views/087bb77ee1021a12882b9d85d430c19f0d6eafd5.php', '__data' => array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'obLevel' => '2', 'apps' => object(LengthAwarePaginator), 'isUserRegEnabled' => false), 'obLevel' => '3', '__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'apps' => object(LengthAwarePaginator), 'isUserRegEnabled' => false)) in 087bb77ee1021a12882b9d85d430c19f0d6eafd5.php line 49
at include('/home/jcostanzo/Development/AndroidAppAddicts/storage/framework/views/087bb77ee1021a12882b9d85d430c19f0d6eafd5.php') in PhpEngine.php line 42
at PhpEngine->evaluatePath('/home/jcostanzo/Development/AndroidAppAddicts/storage/framework/views/087bb77ee1021a12882b9d85d430c19f0d6eafd5.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'obLevel' => '2', 'apps' => object(LengthAwarePaginator), 'isUserRegEnabled' => false)) in CompilerEngine.php line 59
at CompilerEngine->get('/home/jcostanzo/Development/AndroidAppAddicts/resources/views/shared/nav.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'obLevel' => '2', 'apps' => object(LengthAwarePaginator), 'isUserRegEnabled' => false)) in View.php line 149
at View->getContents() in View.php line 120
at View->renderContents() in View.php line 85
at View->render() in fd73ddc8e6fd1fc6ec92a3b3875846744ac5c201.php line 25
at include('/home/jcostanzo/Development/AndroidAppAddicts/storage/framework/views/fd73ddc8e6fd1fc6ec92a3b3875846744ac5c201.php') in PhpEngine.php line 42
at PhpEngine->evaluatePath('/home/jcostanzo/Development/AndroidAppAddicts/storage/framework/views/fd73ddc8e6fd1fc6ec92a3b3875846744ac5c201.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'obLevel' => '1', 'apps' => object(LengthAwarePaginator))) in CompilerEngine.php line 59
at CompilerEngine->get('/home/jcostanzo/Development/AndroidAppAddicts/resources/views/layouts/app.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'obLevel' => '1', 'apps' => object(LengthAwarePaginator))) in View.php line 149
at View->getContents() in View.php line 120
at View->renderContents() in View.php line 85
at View->render() in 4bcc2a028f6aa437625c3351c8d8fe3307f89f04.php line 15
at include('/home/jcostanzo/Development/AndroidAppAddicts/storage/framework/views/4bcc2a028f6aa437625c3351c8d8fe3307f89f04.php') in PhpEngine.php line 42
at PhpEngine->evaluatePath('/home/jcostanzo/Development/AndroidAppAddicts/storage/framework/views/4bcc2a028f6aa437625c3351c8d8fe3307f89f04.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'apps' => object(LengthAwarePaginator))) in CompilerEngine.php line 59
at CompilerEngine->get('/home/jcostanzo/Development/AndroidAppAddicts/resources/views/home/index.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'apps' => object(LengthAwarePaginator))) in View.php line 149
at View->getContents() in View.php line 120
at View->renderContents() in View.php line 85
at View->render() in Response.php line 45
at Response->setContent(object(View)) in Response.php line 201
at Response->__construct(object(View)) in Router.php line 1028
at Router->prepareResponse(object(Request), object(View)) in Router.php line 653
at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Router.php line 655
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 629
at Router->dispatchToRoute(object(Request)) in Router.php line 607
at Router->dispatch(object(Request)) in Kernel.php line 268
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Kernel.php line 150
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 117
at Kernel->handle(object(Request)) in index.php line 53
at require_once('/home/jcostanzo/Development/AndroidAppAddicts/public/index.php') in server.php line 21

Screenshot of the code

http://imgur.com/a/bwyc2