Laravel 5.1 - artisan make command - view

in Laravel 4.2 by using JeffreyWay/Laravel-4-Generators we could use
php artisan generate:view my-view
to create a view named my-view.blade.php.
Now in Laravel 5.1 what we should use to generate a view?
php artisan make:???

According to package's developer, you need to use L5 version instead. Now you are able to run php artisan generate:view.
As a reminder, these commands are not native of laravel artisan console.

In laravel 5.1 no artisan command for make/generate view.

You can install sven/artisan-view package to make view from CMD, to install package write this command:
composer require sven/artisan-view --dev
After installing it, you can make a single view or folder with all views that contain {index-create-update-show}
To make a single file we using this command:
php artisan make:view Name_of_view
For example
php artisan make:view index
To make a folder that contain all resources index - create - update - show write name of folder that contain all this files for example:
php artisan make:view Name_of_Folder -r
For example:
php artisan make:view blog -r
-r is a shorthand for --resource you can write full name or shorthand to make resource.
For more view docs

Related

Laravel package migrations not available after migrate:fresh

I've installed this package following the instructions.
Now if I run migrate:fresh the wink tables are not there. For other packages the tables are created so I'm not sure why this is.
If I run php artisan wink:migrate it does create the tables, but as I often run php artisan migrate:fresh --seed I would like the wink tables to be created on that command and directly seed them with data like I do with other packages.
For some reason, the author of this package creates a custom command for migration and as can see on official documentation of it After each update, make sure you run these commands: php artisan wink:migrate.
You can overcome this by creating a custom Artisan command.
For example make php artisan make:command FreshDatabase and in that class add what you need, i.e. call:
php artisan migrate:fresh --seed
php artisan wink:migrate
How to create a custom command, you can see on the Laravel Documentation. Source: https://laravel.com/docs/7.x/artisan

How to Install Vue.js in Laravel 6.2

i am using laravel 6.2 and now i want install Vue.js.i am trying like this
composer require laravel/ui.
php artisan ui vue.
php artisan ui vue --auth.
npm install.
npm run dev.
but when i try to run command php artisan ui vue its says Could not open input file: artisan
You cant use php artisan if you are not inside a laravel project folder.
That is why it says 'Could not open input file - artisan'.
You need to be inside laravel folder & make sure that artisan file exist there
If you are on Linux/MAC then use ls command, if you are on Windows then use dir command to check your current directory
You cannot use php artisan if you are NOT inside a laravel project folder.
Just use cd to go to your project_directory and try again

I have downloaded laravel project but it has no artisan file in root directory

I have downloaded laravel project from friends website but it has no artisan file in the root directory.
When I run php artisan list it gives an error:
could not open input file: artisan
Just pull it from here, and test with php artisan
You can't use php artisan if you are not inside your downloaded Laravel project folder. That is why you got an error could not open input file artisan
Go to your project directory using cd command in your command prompt For example: cd YourProjectName, Now you will be able to run php artisan list or php artisan it will display you list of all available commands.
NOTE: If you need Laravel installation then don't download the project on other websites. Always prefer the official document for installation.

There are no commands defined in the "passport" namespace. When installing API Authentication In laravel

I am getting below error when i run
php artisan passport:install
[Symfony\Component\Console\Exception\CommandNotFoundException]
There are no commands defined in the "passport" namespace.
For installing laravel passport make sure you add this line to config/app.php in the providers array (package service providers section):
Laravel\Passport\PassportServiceProvider::class,
Then install the package and migrate the database
composer require laravel/passport
php artisan migrate
php artisan passport:install
Clearing out the cache is generally helpful first step when commands are not working, especially when you update anything in the config folder on .env files.
php artisan config:clear
php artisan config:cache
Config clear removes the configuration cache file. Config cache creates a new configuration cache file with the current settings. Config cache enables faster load times for your apps!
I got solution. After running following two commands every thing work fine.
run php artisan cache:clear
run php artisan config:cach
I was searching for a solution for this and I found simple one that worked for me:
Add these lines to $commands array in app/Console/Kernel.php
\Laravel\Passport\Console\InstallCommand::class,
\Laravel\Passport\Console\KeysCommand::class,
\Laravel\Passport\Console\ClientCommand::class,
Try running composer require laravel/passport "~9.0" before running php artisan passport:install
Just follow these steps:
composer require laravel/passport.
Once the installation finishes, add the following provider in the config/app.php file: Laravel\Passport\PassportServiceProvider::class,
php artisan migrate
php artisan passport:install
Here Is the solution of install Laravel passport with mongodb:
Just replace the Illuminate\Database\Eloquent\Model; with Jenssegers\Mongodb\Eloquent\Model in below files:
..\vendor\laravel\passport\src\Token.php,
..\vendor\laravel\passport\src\AuthCode.php
..\vendor\laravel\passport\src\Client.php
..\vendor\laravel\passport\src\PersonalAccessClient.php
and protected $table= "Table_name" variable with protected $collection="Table_name"

Laravel VentureCraft/revisionable error migration table

I have a problem with install VentureCraft/revisionable in Laravel.
When I trying use this command:
php artisan migrate --package=venturecraft/revisionable
Artisan returned error:
[Symfony\Component\Console\Exception\RuntimeException] The "--package"
does not exist.
I using Laravel version 5.2
Simply, you can migrate by:
php artisan migrate --path=vendor/venturecraft/revisionable/src/migrations
The --package syntax was only available in Laravel 4. It seems like this package has old documentation based off that release.
You'll need to go into the vendor/venturecraft/revisionable/migrations folder and copy the migration and insert it in your database/migrations folder.
Then run the command php artisan migrate.

Resources