Laravel Telescope is not adding telescope.php in config folder - php

I have tried to install telescope according to Jeffrey's video.
I am using the latest version of laravel. I have installed according to the laravel documentation for installing as dev.
But, don't get the file config/telescope.php and app\Providers\TelescopeServiceProviders.php in config folder.
Need to mention:
--I have used use Laravel\Telescope\TelescopeServiceProvider namespace in AppServiceProvider.php

Related

Call to undefined method Illuminate\Database\Query\Builder::fireCustomModelEvent()

I have a project that was created by someone else using Laravel 5.2. I thought I should update this project to at least Laravel 5.3 using the Laravel Guide. When I serve my application it runs correctly but when I try to authenticate myself it gives the error: Call to undefined method Illuminate\Database\Query\Builder::fireCustomModelEvent()
When I discard the changes in the composer.lock file the run composer install, it's fine (obviously does not recognise the Laravel 5.3 changes). This happens when I run composer install.
Try searching your entire project directory for references to fireCustomModelEvent. My suspicion is that you have a library listed in your composer.json file that should have been updated and didn't get updated as part of your migration.
If you have any listings in your vendor folder that turn up results, you will need to update the corresponding package in your composer.json file.

Laravel - Install package via composer and access it in controller

I have an laravel application and I need to install this package lunar-calendar
I install it and the package shows in vendor folder:
The package documentation tells to required the package like this:
use yzha5\LunarCalendar;
I put this way but also try this in controller:
use App\yzha5\LunarCalendar;
but returns not found.
I also run the command to publish vendor but doesn't work.
How can I use this package?
The package doesn't contain a service provider, so publish vendor will accomplish nothing really.
use yzha5\LunarCalendar;
\\ will not work because it isn't registered in your service provider that this alias equals the package path
use App\yzha5\LunarCalendar;
\\ will not work because there isn't a folder in app directory named yzha5.
Since it's just two classes and not exactly a decently build package, I'd just fetch those two files into a directory at your choosing, change the namespace and call them.

Laravel admin panel for existing project

I am now developing a project with Laravel 5.4
I need to add an Admin Panel over this existing project, but from what I see, there are quite few options for that.
One option is AdminLTE, but documentation on installing over existing project is very undetailed.
It also requires me to delete default Laravel Auth Controller, which is really not an option for me, because I've done a lot of changes in it.
Can you please recommend any admin panel that would be easy to install on existing project ?
Or should I write it myself ? But I'm not sure I can handle it.
i can recommend you a voyager package for laravel 5
step:1 composer require tcg/voyager
step:2 set up your .env file
step:3 put following 2 line in your app.php
TCG\Voyager\VoyagerServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
step:4 php artisan voyager:install
step:5 run your migration -> php artisan migrate
and then go to
localhost:8000/admin
or whatever your server is
Here I would recommend you to adopt a Laravel admin panel which I am using it already. That was the best Admin template which I've seen in recent days. Name of the product is Josh and available on Codecanyon.
Here is the link of the product where you can get it
https://codecanyon.net/item/josh-laravel-admin-template-front-end-crud/8754542?s_rank=9
You don't even need to follow the installation instruction provided by AdminLTE. As its a frontend template, just copy the css and js files of AdminLTE to your Laravel's public folder. Then take the html pages that you need from AdminLTE. You need to update the css and js links of that html with the new path of those file in your Laravel(use asset method).
Supposition: You are with Laravel 5.4
Add admin-lte Laravel package with:
composer require "acacha/admin-lte-template-laravel:4.*"
To register the Service Provider edit config/app.php file and add to providers array:
Acacha AdminLTE template provider
Acacha\AdminLTETemplateLaravel\Providers\AdminLTETemplateServiceProvider::class,
To Register Alias edit config/app.php file and add to alias array:
Acacha AdminLTE template alias
'AdminLTE' => Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::class,
Finally Publish files with:
php artisan vendor:publish --tag=adminlte --force
Use force to overwrite Laravel Scaffolding packages. That's all! Open the Laravel project in your browser or homestead machine and enjoy!

Routes file lost - Laravel

Just started out working with Laravel and Homestead.
I followed below guide for that :
https://www.youtube.com/watch?v=S3kaQDFJiis
and did everything exactly the same, but when I open my project Laravel/app/Http there's no routes.php file just kernel.php.
What could possibly cause this? How to fix this? Maybe I messed up something during installation? I did try to re-install everything, but I faced same problem.
If you're using the latest version of Laravel, the routes can now be found in
Laravel/routes/
This folder contains 3 different files each used for their respective consumption methods api web console
I think you are using laravel latest version which is "5.3.*".
From laravel 5.3 routes has found a new home which is under
projectname/routes/.
routes directory has 3 php file
api.php
console.php
web.php
You can check your Laravel version form projectname/composer.json under require as "laravel/framework": "5.3."*
Reference:
Laravel 5.3
Keep note that from Laravel 5.3 the routes.php file has been removed and moved to
laravel_project_folder/routes/web.php
laravel_project_folder/routes/api.php
See Laravel 5.3 Routing Docs & Laravel Upgrade Guide Section
Hope this helps!
You will find it in
1)routes/web.php
You can also read the use of api.php and console.php files as they are also used in routing

Laravel package development

I am trying to develop a Laravel package with a helper function, which returns a view. I have uploaded on GitHub already https://github.com/faisalahsan/laravel-breadcrums. When I install it through Packagist https://packagist.org/packages/faisalahsanse/laravel-breadcrums, it installs successfully, but when I register it in the provider array in my app.php as Faisalahsanse\Breadcrums\BreadcumsServiceProvider::class,. It gives the following error:
Class 'Faisalahsanse\Breadcrums\BreadcumsServiceProvider' not found
I don't know where I am getting wrong.
Any suggestions?
Your namespace is wrong https://github.com/faisalahsan/laravel-breadcrums/blob/master/src/BreadcumsServiceProvider.php#L2
It should be Faisalahsan\LaravelBreadcrums. As this namespace you are adding in the composer.json file in psr-4 autoload.
Also your provider to add will be Faisalahsan\Breadcrums\BreadcumsServiceProvider::class

Categories