devonian

devonian

Member Since 2 Years Ago

Experience Points 860
Experience Level 1

4,140 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 0
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.

04 Dec
7 months ago

devonian left a reply on Incorrect Date Value

Can anyone else help? This is a minor issue, any help would be much appreciated...

devonian left a reply on Incorrect Date Value

@REALRANDYALLEN - Unfortunately that has been no different, damn code!! Thanks anyway.

devonian left a reply on Incorrect Date Value

@REALRANDYALLEN - Thanks for coming back to me, unfortunately I'm getting the following error:

syntax error, unexpected 'if' (T_IF)

devonian left a reply on Incorrect Date Value

Sorry, further my previous post, November dates are unaffected. It's the 31st December which isn't being blocked out...

devonian left a reply on Incorrect Date Value

@REALRANDYALLEN - Hey realrandyallen,

Thanks so much for coming back to me - much appreciated! Yeah I agree, I think this is what's happening, any suggestions on how I can fix this?

Thank you again!

devonian left a reply on Incorrect Date Value

Sorry to ask again, just wanted to give this a nudge, please can someone help me out here, been pulling my hair out all afternoon! :(

devonian started a new conversation Incorrect Date Value

Hi all, bit stumped on small problem, I'm trying to disable dates over the Christmas period. For some reason the last date in December is returning the incorrect month. Please see my code below:

disabledDates = [
    new Date(2018,3,2),
    new Date(2018,2,30),
    new Date(2018,4,28),
    new Date(2018,7,27),
  ];

  @php
  $arrival = strtotime('-1 day', strtotime(env('CHRISTMAS_ARRIVAL_DATE')));
  $return = strtotime('+1 day', strtotime(env('CHRISTMAS_RETURN_DATE')));
  @endphp

  christmasDates = [
  @while($arrival <= $return)
    @php
    $month = date('n', $arrival) == 1 ? 0 : date('n', strtotime('-1 month', $arrival));
    @endphp
    new Date({{ date('Y', $arrival) }},{{ $month }},{{ date('d', $arrival) }}),
    @php
    $arrival = strtotime('+1 day', $arrival);
    @endphp
  @endwhile
  ];

  $.merge(disabledDates, christmasDates);

Output

//Dates disabled...
  disabledDates = [
    new Date(2018,3,2),
    new Date(2018,2,30),
    new Date(2018,4,28),
    new Date(2018,7,27),
  ];

  
  christmasDates = [
          new Date(2018,11,17),
              new Date(2018,11,18),
              new Date(2018,11,19),
              new Date(2018,11,20),
              new Date(2018,11,21),
              new Date(2018,11,22),
              new Date(2018,11,23),
              new Date(2018,11,24),
              new Date(2018,11,25),
              new Date(2018,11,26),
              new Date(2018,11,27),
              new Date(2018,11,28),
              new Date(2018,11,29),
              new Date(2018,11,30),
              new Date(2018,12,31),
              new Date(2019,0,01),
              new Date(2019,0,02),
              new Date(2019,0,03),
              new Date(2019,0,04),
              new Date(2019,0,05),
              new Date(2019,0,06),
              new Date(2019,0,07),
              new Date(2019,0,08),
              new Date(2019,0,09),
              new Date(2019,0,10),
        ];

  $.merge(disabledDates, christmasDates);

I'm sure it's a simple fix, just struggling to get my mind around it, having a bit of a brain fart! Thanks folks.

14 Nov
8 months ago

devonian left a reply on If Condition Error

Thanks guys, massive help! You've helped me out no end, thank you so much! Much appreciated. All working beautifully now. Your good folks helping others out, thank you so much!

devonian left a reply on If Condition Error

I need analytics to be enabled for logged in/logged out users except if the logged in user is an admin. Hope this helps. Thanks for your input so far, really appreciated...

devonian left a reply on If Condition Error

I've just tried your suggestion, problem now is that analytics are now disabled for users which are not logged in...

devonian left a reply on If Condition Error

Hi Cronix, thanks for replying to my post. Only problem is that doesn't check if the user is an admin user. I'm wanting to disable Google Analyitics only if an admin is logged in. I've tried the follow:

@if(App::environment('production') AND Auth::user()->admin != 1)
//
@endif

Which does work when the admin is logged in but if no one is logged in it causes a fatal error:

Trying to get property 'admin' of non-object 

I only want it to be disabled if an admin user is logged in...

devonian started a new conversation If Condition Error

Hi all, having a bit of a hard time - basically I'm wanting to disable Google Adwords when an admin user is logged into the site. The problem is I get a fatal error if a user isn't logged in at all. Please could someone help...

@if(App::environment('production'))
    @if(isset(Auth::user()->admin != 1)
    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

      ga('create', 'UA-85606461-1', 'auto');
      ga('send', 'pageview');
    </script>
  @endif
@endif
12 Jul
1 year ago

devonian left a reply on Accessing Object Properties...

Thank you so so so much brysonreece, you've proper helped me out. Really appreciated buddy, thank you. It works a beauty now!

devonian left a reply on Accessing Object Properties...

Hey there, just tried your suggestion, but unfortunately getting the following error:

Undefined property: Geocoder\Provider\GoogleMaps\Model\GoogleAddress::$coordinates

The documentation leaves a hell of a lot to be desired for!!

devonian left a reply on Accessing Object Properties...

Thank you, both of you for replying to my question so promptly, much appreciated. Cronix, the output as you requested is:

Collection {#811 ▼
  #items: array:1 [▼
    0 => GoogleAddress {#812 ▼
      -id: "ChIJxYJefgwGbUgRu4x71J_3_ls"
      -locationType: "ROOFTOP"
      -resultType: array:1 [▶]
      -formattedAddress: "London, UK"
      -streetAddress: null
      -intersection: null
      -political: "United Kingdom"
      -colloquialArea: null
      -ward: null
      -neighborhood: null
      -premise: null
      -subpremise: null
      -naturalFeature: null
      -airport: null
      -park: null
      -pointOfInterest: null
      -establishment: null
      -subLocalityLevels: AdminLevelCollection {#813 ▼
        -adminLevels: []
      }
      -coordinates: Coordinates {#814 ▼
        -latitude: 50.5464276
        -longitude: -3.5960816
      }
      -bounds: Bounds {#815 ▶}
      -streetNumber: "2"
      -streetName: "Oakford"
      -subLocality: null
      -locality: "Newton Abbot"
      -postalCode: "TQ12 3EG"
      -adminLevels: AdminLevelCollection {#816 ▶}
      -country: Country {#819 ▶}
      -timezone: null
      -providedBy: "google_maps"
    }
  ]
}

devonian started a new conversation Accessing Object Properties...

Hi all, I'm trying to implement geocoding into my application. Having a hard time accessing the properties of the object. Please see below:

Package -> https://github.com/geocoder-php/GeocoderLaravel

My code ->

Route::get('geocode', function(){ $geo = app('geocoder')->geocode('London, UK')->get(); dd($geo->first()->getCoordinates()->latitude); });

Problem -> Cannot access private property Geocoder\Model\Coordinates::$latitude

Feel silly asking this, but how the hell do I access the latitude/longitude??

28 Apr
1 year ago

devonian left a reply on JQuery Issue

Hey, thanks for the reply - yeah I get that - but I'd like to menu to stay open until the new page has loaded, apologies, I should have mentioned that.

Currently, when it's clicked, it slides straight back up, which I feel is a little unnatural...

devonian started a new conversation JQuery Issue

Hi all, I'm having a bit of a hard job trying to fix this issue. I'm trying to build a mobile dropdown menu, which I have done.

Problem -> When a user clicks on the link, the dropdown menu slides back up - I don't want this to happen. The dropdown menu should remain 'dropped' down. Please see my code below:

<li class="dropdown-parent">
      <a href="{{ route('lens-rental') }}">Lenses for Hire</a>

      <ul>
        <li><a href="{{ url('hire/telephoto-lenses') }}">Telephoto Lenses</a></li>
        <li><a href="{{ url('hire/standard-lenses') }}">Standard Lenses</a></li>
        <li><a href="{{ url('hire/wideangle-lenses') }}">Wide-Angle Lenses</a></li>
        <li><a href="{{ url('hire/macro-lenses') }}">Macro Lenses</a></li>
        <li><a href="{{ url('hire/fisheye-lenses') }}">Fisheye Lenses</a></li>
      </ul>
    </li>

My jQuery is:

//Handle dropdowns...
    $('.dropdown-parent').click(function(){
      //alert('fo');
      $(this).children('ul').slideDown('medium');

      //Change icon to minus icon...
      if($(this).hasClass('open')){
        $(this).removeClass('open');
      } else {
        $(this).addClass('open');
      }
    })

Any help here would be hugely appreciated, many thanks for taking the time to read this.

27 Dec
1 year ago

devonian left a reply on Problems With Hosting - PHP7

Hi xmarks,

Apologies for the delayed reply - hope you have a great Christmas.

I've spoken to my superiors and using Forge is not an option.

Can you recommend any hosts that are truly PHP 7 ready, with PHP 7 on the command line - most seem to use PHP 5.4 and instead layer 7 on the top of it...

15 Dec
1 year ago

devonian started a new conversation Problems With Hosting - PHP7

Hi all, I've been having real problems with my webhost since I upgraded the Laravel 5.5 as it requires PHP 7 as a minimum.

The problems I seem to have encountered is that most hosting companies servers come preinstalled with PHP 5.4 - you can then choose within Plesk a PHP version (such as PHP 7) which is essentially 'layered' on top.

Problem is this doesn't install PHP 7 on the command line - so making updates, etc doesn't work. Making things a real headache.

I've spoken to my host about manually installing PHP 7 on the command line and they highly advised against doing this as it would likely break things. I went against their advice and did install PHP 7 on the command line, and it did rather spectacularly cause carnage.

I have tried using LaravelForge but really wasn't keen on the whole setup.

I guess I'm asking what can I do? Can anyone recommend any good hosts where PHP 7 is installed as standard on the command line?

Really hope someone can assist me here.

23 Oct
1 year ago

devonian left a reply on Group Routing - Controller Not Found

Hi there, many thanks for your quick reply. I had made a clean install of Laravel 5.5 and then migrated everything across - I foolishly forgot to transfer the Middleware folder.

Thank you pointing that out and helping me fix the issue, much appreciated.

21 Oct
1 year ago

devonian started a new conversation Group Routing - Controller Not Found

Hi everyone, just finished upgrading our web-app to Laravel 5.5, from 5.4. I seem to have an issue where any route inside of a route group doesn't appear work, I'm displayed with an error saying 'Class basket does not exist'.

My routes files looks like:

Route::middleware('basket')->prefix('basket')->group(function(){
    Route::get('/', '[email protected]');
    Route::post('basket/shipment', '[email protected]');
    Route::post('basket/loyalty', '[email protected]');
    Route::post('basket/discount', '[email protected]');
    Route::get('basket/remove-discount', '[email protected]');
    Route::get('basket/remove/{id}', '[email protected]');
    Route::get('basket/destroy', '[email protected]');
    Route::resource('basket', 'BasketController');
  });

Any help would be hugely appreciated.

25 Jul
1 year ago

devonian left a reply on Global Method - Newsletter Subscribe

Hello,

Sure, I'll have three separate forms across the site - all of which is to subscribe to our newsletter. We require two bits of information, first name and email address.

However, at the basket, we have a checkbox which says allows the user to subscribe (as by reaching the basket they will have created an account and we'd already have their data) hence why we have just a checkbox.

I desire to enter the data [first name, email] into a newsletter table.

So, we have three forms across the site and checkbox as points where I'd like to add functionality to insert record into newsletter table.

Hope this makes sense.

devonian left a reply on Global Method - Newsletter Subscribe

Hello, thank you all for your replies much appreciated. topvillas you are correct - there will be several forms the user can subscribe from.

36864, I wouldn't be able to use AJAX for this particular thing.

I'll take a look into a trait, not used these before - is this what you mean?

http://culttt.com/2014/06/25/php-traits/

devonian started a new conversation Global Method - Newsletter Subscribe

Just a quick one - I need to implement a newsletter subscribe/join function - there are several places throughout the site where you can join up/subscribe.

I can't use a route to handle this as I need to be able to subscribe a user from within another route.

Any suggestions, please?

24 Jul
1 year ago

devonian left a reply on SASS Showing In Inspector

Ignore me, just worked it out - I had source map selected in my asset compiler! I need sleep...!!

devonian started a new conversation SASS Showing In Inspector

Hi all, just a quick question - why is my SASS being shown as the source (content.scss) in the inspector rather than the compiled CSS file? Can provide a picture if that clarifies somewhat.

I've tried seeing if Laravel is including the path to the scss file [/resources/assets/sass/content.scss] but it's no where to be found in the page source so I'm not too sure where it's getting that from.

I'm quite confused!

06 Jul
2 years ago

devonian left a reply on Accessing User Object From Within Notification Blade Template

Awesome, thank you so much - that worked a charm. Not sure why I didn't think of that myself, brainfart moment!

Thanks for your concise and speedy reply.

devonian started a new conversation Accessing User Object From Within Notification Blade Template

Hello all, just a quick question - is it possible to access the user object from within a Notification Blade template?

It would be great if I could add the users first-name to the master template rather than individually adding the greeting line to the Notification classes.

Thanks in advance :)

19 Mar
2 years ago

devonian started a new conversation Loyalty Scheme

Hi all, I've been tasked with creating a loyalty programme, where by the user will receive 5% off their order value as loyalty. I've built a variety of websites in the past, but have never built a loyalty scheme/programme.

I've had a look for some packages but there doesn't seem to much on offer...so thinking I'm going to need to roll this feature out myself, can anyone provide any pointers please?

Would massively appreciate any advice. Thanks in advance!

devonian left a reply on Ecommerce Recently Viewed Products

Hi martinbean,

Thanks for your prompt reply - much appreciated. That's a big help, thank you for pointing me in the right direction.

The brief is to display the last eight most recently viewed products globally, just above the footer of the site...

Thanks in advance!

17 Mar
2 years ago

devonian started a new conversation Ecommerce Recently Viewed Products

Hello, first time posting on here so please go gentle on me :) I've been asked to build a recently viewed product list into my ecommerce application - though I'm a little stumped as to how to go about integrating this.

Any suggestions or advice? I did think middleware might be an option...?

Thanks in advance!