View [layouts.app] not found in laravel - laravel

I have created an application in laravel using appzcoder crud-generator plug-in. i have done everything accordingly but i am getting the above mentioned error. I have a folder named layouts in views folder and this folder has app.stub in it. but when i run the project it gives the following error
View [layouts.app] not found. (View:C:\wamp64\www\myProject\resources\views\admin\items\index.blade.php)

make sure you have run below code if not run it will create layout.app path
or manually create view/layout/app.php
php artisan vendor:publish --provider="Appzcoder\CrudGenerator\CrudGeneratorServiceProvider"

Related

Laravel - black-bits/laravel-cognito-auth causing issues in default route

I've installed a laravel package black-bits/laravel-cognito-auth .
When i run php artisan route:list on command line, i've the following error:
Target class [App\Http\Controllers\Auth\ResetPasswordController] does not exist.
I'm not using ResetPasswordController in that specified path.
My ResetPassword controller's path is here: \app\Http\Controllers\Api\V1\Account\ResetPasswordController.php.
I'm mainly using this project for apis.
when i search for this path in vendor folder, i can see this.
.
Since, these routes are in vendor folder, what can i do to fix this issue?

new view under vendor/mail/html not found

I have message.blade.php file under vendor/mail/html and it works correctly. then I want to customize this file and create another view that called "message-with-bg.blade.php" but I get "view not found" error. How to add a new file under vendor/mail/html correctly?
first, did you run the command below, so that you are editing views inside your resources/views folder and not actual vendor folder? You should never change your actual vendor folder, because changes will be removed the next time you run any composer command, or run the code on different machine.
php artisan vendor:publish --tag=laravel-mail
After that, you would need to edit the build function inside your Mail class, like:
public function build()
{
return $this->view('emails.message-with-bg');
}

Create own laravel package

I try to create own laravel package.
I created package folder in my project in root directory.
Than created simplexi/greetr/src folders in package.
I added to autoload "Simplexi\Greetr\": "package/simplexi/greetr/src" in composer.json in main project, and used command composer dump-autoload.
Than in src folder I created RiakServiceProvider, added this provider to config=>app.php to providers array.
Then in boot method I added next code:
$this->publishes([__DIR__ . '../config/myconf.php' => config_path() . '/']);
And executed next command:
php artisan vendor:publish --provider="\Simplexi\Greetr\RiakServiceProvider"
Than I got Publishing complete.
But file myconf.php didn't copy to app/config.
Also I checked file myconf.php in my package/simplexi/greetr/config folder and it exists.
Can anyone tell me what the problem might be?
publishes() expect two parameters. Try something like this:
$this->publishes([
__DIR__.'/../config/myconf.php' => config_path('myconf.php'),
], 'config');

Laravel 5.1 remove controller

I have simple question on Laravel 5.1. I have created a controller using php artisan command:
php artisan make:controller PageSettings
However it was mistake, because I really wanted to create this controller in Admin folder like this:
php artisan make:controller Admin/PageSettings
Now I want to get rid of my old PageSettings controller. Is it ok just to delete my old PageSettings.php manualy? Or there is something more what needs to be done?
If you only created it and found that you did it wrong, you can manually remove the file and that's it. However when you already added routes to this controller in routes.php you should remove them from routes.php file or alter the file to reflect your new controller.
It is OK to manually delete controller. Just check routes.php if you have some route to that controller and delete it also.
I had an issue with just deleting the file. I tried running my PHPUnit test suite and got an error that looked like this:
Warning: include(): Failed opening '/user/home/me/some/file.php' for inclusion (include_path='.:') in /usr/home/me/some/vendor/composer/ClassLoader.php on line 444
I had to run composer update then composer dump-autoload. After that, everything worked just fine.
Yeah, you can delete manually without tension.
I will suggest you for avoiding more mistakes, you "phpStrom" software, from using this, if you delete manually any file from by click right of mouse->Refactor->safe delete then before deleting they will give all places which were using your file. by clicking "do refactor" you can delete it.

Laravel 4 (4.2.8) Generate model in app folder and not model

When I run this command
php artisan generate:model Post
it generates the Post.php at app/Post.php and not in model. What I am doing wrong?
You can force the path by adding path option
Try this
php artisan generate:model Post --path=app/models
The reason it is placing new file in app directory is because you must have edited the path in your config file.
See more about configurations

Resources