Laravel 5.8 – From The Ground Up - Laravel 5.8 Tutorial From Scratch – e41 – Telescope

Education, Programming

Laravel 5.8 – From The Ground Up

52 Lessons

Laravel 5.8 Tutorial From Scratch – e41 – Telescope

as part of the laravel eco system there is a utility called laravel telescope it is actually maintained by the core laravel team and it is a way for us to

tap into our application and find out what's going on behind the scenes now this tool is incredibly powerful but incredibly simple to install and this is something that will help newcomers

tremendously so I am inside the documentation for laravel telescope you can Google Lenovo telescope but I will put the link down below in the description so let's read through the

introduction and find out how to do the installation so it looks like a simple composer required which we've done before then we need to run a couple of PHP artisan commands to install it and

then another one to migrate our database and that's it with those three commands we are good to go now there is this section here talking about how to only install in a

specific environment now we have not touched up on the subject just yet but composer is able to have different requirements for production and different requirements for your

development environment and this is very powerful for something like telescope if you only want a telescope to be available during the development process but you do not want to deploy that to

production that's what you would do you would add the – – dev and that will put telescope in a separate part of your composer of that JSON file that is only installed if you are in local

environment alright let's dive right in and get this installed I'm going to compose a require level telescope in our project and let's wait for it to install and it's done now do notice here that we

have a new discovered package which is of course the letter ville telescope let's head back to the documentation and find out what's next so now we need to run PHP artisan telescope install let's

run that now and there we go and finally let's go ahead and migrate our database so we see that telescope created a new table in our database called telescope entries great so now we

can go back to the browser and in our app we can visit our app telescope so this is laravel telescope now we're gonna do a quick overview of telescope but I definitely encourage you

to spend some time with it trying to look through it and see how it works so we have this requests and the way that would work is if we visit our project in a separate screen we go back here and we

do see that we had two requests we obviously try to fetch the customers and then we had a redirect back to the login page all right so back here let's try to go to the contact us page and let's

check out what happened load new entries and there we are so we can see that behind the scenes telescope is continually looking in our app and telling you what's going on so obviously

if we go to the commands section very similar section here let's run a command let's go back to our terminal run PHP artisan let's go back load new entries and now we see that we ran the list

command obviously the list command is just when we run PHP artisan it gives us a list of commands so that's pretty cool now when we did our jobs before obviously this is where they would go

between schedules and jobs exceptions if we have a runtime error exception that's where those would go we have access to our logs and dumps in queries so this section is very cool we're actually able

to see every single query that we're running behind the scenes so for example if we load it up our customers list we go ahead and register a user very quickly so I can log in test user all

right so let me visit the customers list so we have one customer here so now we see that we loaded our customers and then we loaded our companies and the reason for that is that our company is

actually being lazy loaded through our relationship let's go back to phpstorm so I can show you that let's go to the customers index and if we look down here you see that customer is calling the

company relationship and then calling the name so this actually brings us to a problem we're gonna solve this in the neck episode but check this out if we

actually generated a lot of customers you're gonna see we're gonna end up with a lot of duplicated queries so let's do that now let's go to PHP artisan tinker and let's use our factories to whip up

let's say 50 customers whoops start again there we go so now we have a lot of customers go back to our browser hit refresh and now you see we have a lot of customers but now if we load

telescope we have what is called an n +1 problem so we're actually gonna solve this in the next episode but check out how many queries we are running with that simple operation now of course if

we were to add even more customers it keeps getting even worse so that is an important thing to remember so in the next episode we're gonna take a look at how to fix this so that we keep our

queries to a very very minimum count so stick around

Laravel Telescope provides incredible feedback on what is going on behind the scenes with your application. It is an extremely powerful tool but very simple to install. Follow along as we install and do an overview on Laravel Telescope.

For the best experience, follow along in our interactive school at

Laravel Telescope

DigitalOcean Referral

Course Source Code

Hit us up on Twitter with any questions or comments @codertape (

About This Course

Ready to get started on your path to Laravel Artisan? In this series, we are breaking down all of the basics of Laravel to get you comfortable using the world’s most popular PHP framework. Let’s get started!

    add to database laravel admin laravel artisan Artisan Command artisan commend create artisan console artisan laravel command authentication in laravel belongsto belongsto laravel example coding tutorials create artisan command create command artisan create new command artisan Create your own crud laravel crud laravel tutorial crud resource laravel crud with file upload custom artisan commands custom artisan commands laravel custom laravel database configuration laravel database relationship digital ocean dotenv eager loading eager loading in laravel eager loading vs lazy loading laravel eloquent eloquent accessors eloquent mutators eloquent orm feature testing laravel fetching data in laravel filesystem laravel form requests full stack vue gate and policy laravel google optimize hasmany hasmany laravel hasmany laravel example hasmany relationship in laravel hasone hasone relationship in laravel How to create how to queue email how to use queue installing laravel intervention image laravel laravel 5 laravel 5 auth laravel 5.4 queue laravel 5.5 queue laravel 5.8 laravel 5.8 artisan command laravel 5.8 artisan console laravel 5.8 auth tutorial laravel 5.8 authentication laravel 5.8 commands laravel 5.8 crud laravel 5.8 crud example laravel 5.8 custom middleware laravel 5.8 deprecations laravel 5.8 eager loading laravel 5.8 elixir laravel 5.8 event listeners laravel 5.8 events laravel 5.8 feature laravel 5.8 features laravel 5.8 global middleware laravel 5.8 install laravel 5.8 lazy loading laravel 5.8 listeners laravel 5.8 middleware laravel 5.8 multi auth laravel 5.8 named resource routes laravel 5.8 named routes laravel 5.8 new feature laravel 5.8 own artisan command laravel 5.8 queue laravel 5.8 queues laravel 5.8 routing laravel 5.8 telescope laravel 5.8 tutorial laravel 5.8 user auth laravel 5.8 user authentication laravel 5.8 what's new laravel 5.9 laravel admin permissions laravel api laravel artisan command laravel artisan console laravel assets laravel auth laravel auth role laravel authentication laravel authorization laravel axios post example laravel background process laravel background task laravel background worker laravel beginner to master laravel belongsto laravel belongsto vs hasone laravel belongstomany laravel best packages laravel best practices laravel best tutorial laravel bootstrap laravel command laravel command line laravel commands tutorial laravel composer install laravel connect db laravel console command laravel console testing laravel contact form send email laravel controllers laravel create laravel crud laravel crud policy laravel custom command laravel custom middleware laravel database laravel database configuration laravel database relationships laravel database seeder laravel database settings laravel db seed laravel db settings laravel debugging laravel deploy aws laravel deploy digital ocean laravel deploy on digitalocean laravel deploy on server laravel deploy to production laravel deployment laravel digitalocean laravel drag and drop file upload laravel dropzone file upload laravel dropzone image upload laravel e-commerce laravel eager loading laravel eager loading tutorial laravel eager loading with condition laravel elixir laravel eloquent laravel eloquent belongsto laravel eloquent crud laravel eloquent hasmany laravel eloquent where laravel eloquest tutorial laravel events and queue laravel events tutorial laravel factory laravel feature test laravel feature testing laravel fetching data from database laravel file storage laravel fillable example laravel flash message notification laravel for beginners laravel form validation laravel forms laravel forms bootstrap snippets laravel from scratch laravel from the ground up laravel front end laravel frontend tutorial laravel gate and policy tutorial laravel global middleware laravel hasmany laravel hasone laravel i18n laravel installation laravel installation mac laravel intervention image tutorial laravel javascript tutorial laravel jobs queue laravel language laravel language switcher laravel language tutorial laravel languages laravel lazy loading laravel listener event laravel listeners laravel localization laravel login laravel mailable tutorial laravel many to many relationship example laravel markdown email laravel markdown mail laravel mass assignment laravel middleware laravel migrate fresh laravel mix laravel mix 5.8 laravel mix vue laravel model factory tutorial laravel multiple language laravel mysql json laravel named resource routes laravel named routes laravel new features laravel news laravel nginx laravel node modules laravel npm install laravel npm run watch error laravel one to one laravel paginate laravel paginate link laravel pagination laravel pagination 5.8 laravel pagination links laravel pagination tutorial laravel phpunit laravel phpunit testing laravel pivot table example laravel policy laravel preview laravel query optimization laravel queue laravel queue event listener laravel react laravel register user laravel registration laravel registration validation laravel relationships laravel reset password laravel role middleware laravel role permission laravel roles laravel route group middleware laravel routes laravel routing laravel routing with parameters laravel sass laravel save file to database laravel scopes laravel seo tutorial laravel server laravel session data laravel ssl laravel supervisor laravel tailwind css laravel tailwind setup laravel tdd laravel tdd tutorial laravel telescope laravel telescope installation laravel telescope tutorial laravel test driven development laravel test workflow laravel testing laravel testing controllers laravel testing tutorial laravel tools laravel translation laravel tutorial laravel tutorial for beginners laravel ubuntu server laravel ubuntu tutorial laravel unit testing controllers laravel upload file laravel upload image to storage laravel upload multiple files at once laravel upload multiple image to database laravel upload multiple images laravel url slug laravel vue laravel vue js crud laravel vue setup laravel vue tutorial laravel vue.js laravel webpack error laravel webpack tutorial lazy loading lazy loading laravel lazy loading vs eager loading learn laravel learn laravel framework step by step localization in laravel localization laravel many to many laravel mvc tutorial for beginners in php mvc tutorial laravel mysql mysql relational database mysql relationship n + 1 problem n + 1 problem laravel new artisan command npm install npm run dev npm run watch laravel one to many one to one one to one laravel own artisan command pagination pagination bootstrap pagination bootstrap php mysql pagination laravel pagination laravel bootstrap pagination links pagination php php php artisan php carbon immutable php framework php framework 2019 php what's new 2019 phpunit phpunit laravel phpunit testing pivot laravel policy laravel polymorphic relationships queue and events queue email queue for laravel queue jobs queue laravel 5.8 registration form relationship laravel eloquent relationship mysql restful controller role permission in laravel roles laravel route model binding laravel routing in laravel save image to database seo friendly seo friendly content writing seo friendly website seo laravel seo optimization simple pagination laravel slugify sqlite relational database sqlite relationships between tables symfony command console symfony laravel tailwind css tailwind laravel mix telescope laravel tutorial laravel unit testing unit testing laravel upload file laravel upload file php upload image laravel upload image to database php upload images laravel upload multiple files in php url slug laravel url slug php vue vue.js vuejs laravel why use laravel queue why use queue