Zizaco entrust does not create the entrust.php - laravel

Why the file entrust.php is not created when I run this:
php artisan vendor:publish
I'm following this config and this is my composer.json
"zizaco/entrust": "5.2.x-dev"
"You can also publish the configuration for this package to further customize table names and model namespaces.
Just use php artisan vendor:publish and a entrust.php file will be created in your app/config directory."
But the file entrust.php is not created.
What can I do? This is odd.

In the link you provided they say and, if it does not appear, manually copy the /vendor/zizaco/entrust/src/config/config.php file in your config directory and rename it entrust.php.

just try this
add
"zizaco/entrust": "5.2.x-dev" in composer.json
then composer update.
Then in your config/app.php add
Zizaco\Entrust\EntrustServiceProvider::class,
in the providers array and
'Entrust' => Zizaco\Entrust\EntrustFacade::class,
Next try in your terminal to publish and see in your config
php artisan vendor:publish
--provider="Zizaco\Entrust\EntrustServiceProvider"
check link for how to use zizaco

I solved it by running
php artisan config:cache
Before running
php artisan vendor:publish

run this command
php artisan config:cache
then run
php artisan vendor:publish

Related

Laravel create migration file in specific folder

I've created Payment package for my laravel project
I want to make migration files inside migrations folder of my package. How can create it using artisan command?
I want something like
php artisan make:migration packages/Payment/src/Database/add_orderId_to_cart_payment_table
Use this command on the root folder:
create the only Migration file:
php artisan make:migration create_products_table --create=products
Create Migration, Model file:
php artisan make:model Product -m
For Create Migration,Model,Controller file:
php artisan make:model Product -mcr
If you want to do it manually then you may set --path as per your folder requirement.
php artisan make:migration filename --path=/app/database/migrations/relations
php artisan make:migration filename --path=/app/database/migrations/translations
If you want to migrate then:
php artisan migrate --path="/app/database/migrations/relations"
For specific directories:
php artisan make:migration create_users_table --path=/packages/Payment/src/Database
The new migration will be placed in your packages/Payment/src/Database directory.
For Running Migrations: php artisan migrate --path=/packages/Payment/src/Database
Generating a migration using the inbuilt framework feature:
php artisan make:migration create_users_table
The new migration will be placed in your database/migrations directory.
For Running Migrations: php artisan migrate
you need to publish them from your package to your migrations folder like this in your package service provider boot method:
$this->publishes([
__DIR__.'/Database/migrations/' => database_path('migrations'),
], 'migrations');
run this command php artisan vendor:publish --tag=migrations
and after that you can run php artisan migrate
You can run:
php artisan make:migration --help and see all the options available for you to use.
It seems you are making a package. It has nothing to do with where to create migrations, just create migrations in regular way, run your migrations and simply put them in your package/src/Database/migrations/yourMigrations_xxxxxx.php and in your package serivce provider in boot() method write this line
$this->loadMigrationsFrom(__DIR__ . '/Database/migrations');
laravel has a built in method loadMigrationsFrom('path/to/migrations') to pick up migrations, when someone installs this package and when he'll run php artisan migrate it'll run all the migrations whether they are in the user's Database/migrations or in your package's package/src/Database/migrations/2022_03_29_23424_create_countries_table_.php, all the migrations will run

How to change Base URl of a website - Laravel 5.4

I have a website based on laravel 5.4. The site is working fine on my localhost. But when I upload it on my shared hosting. It is giving me an error
"at FileViewFinder->findInPaths('welcome', array('C:\\xampp\\htdocs\\lrl\\resources\\views'))"
C:\xampp\htdocs\lrl\resources\views this is my localhost URL. How can I changed this URl. I have made changes in .env file and I put all the files of public folder at root directory. Also I changed Appserviceprovider.php file.
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Schema;
use DB;
use View;
use Request;
I also cleared the cache but still i am getting this error shown in screenshot
run php artisan config:cache
C:\xampp\htdocs\lrl\resources\views is cached in your config file. So, you must clear config cache by run artisan command php artisan config:cache.
Clear you route cache
php artisan route:cache
Clear all if still not work
php artisan config:cache
php artisan config:clear
php artisan view:clear

RUN LARAVEL PROJECT MISSING .ENV FILE

How to run laravel project from github on localhost when .env file is missing in the laravel project?
You can rename the .env.example to .env and then run php artisan
key:generate and it'll function as it should.
If you're using a command line simply type cp .env.example .env and
run the key:generate command.
If you are missing the .env files completely, you may take the .env.example file from: https://github.com/laravel/laravel/blob/master/.env.example
Then simply create a new file named .env within your project. You will still need to run php artisan key:generate once you have created the file.
Copy .env.example
Change the name with .env
Make your own settings in .env file.
After that run "php artisan key:generate"

Laravel error with correct key lenghts

I was working with laravel (5.4), everything fine. I cannot remember modifying my .env file but the following error came up in every page:
(1/1) RuntimeException
The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.
I tried every possible answer found on github.
This we're the steps i made:
cp .env.example .env
php artisan key:generate
Application key [...] set successfully.
php artisan config:clear
Configuration cache cleared!
php artisan config:cache
Configuration cache cleared!
Configuration cached successfully!
php artisan cache:clear
Cache cleared successfully.
Also trying config:cache and then config:clear.
No results, error persists.
did you try to put
'cipher' => 'AES-256-CBC',
in your config/app.php ?

Lumen php artisan config:cache not found

I'm trying out the PHP micro Framework Lumen (from laravel).
When I set up Lumen and I try to use the php artisan config:cache command like in Laravel, I get this error :
[InvalidArgumentException]
There are no commands defined in the "config" namespace.
So I have problem when I try to deploy the files to server, so I have to change .env file to change the database username and password.
This makes me think config is not available in artisan
How can I add it to artisan ?
Yes, you can not use the php artisan config:cache with your Lumen project, because it is not available out of the box.
You can add it by adding this package (orumad/lumen-config-cache) to your project:
composer require orumad/lumen-config-cache
In lumen you have to add this configuration in bootstrap/app.php file
$app->configure('custom_config_file_name');
#example
$app->configure('custom_emails');
Then you can access like below:
config('filename.key_name');
#example
config('constants.email');
Lumen no need to config:cache.
You do not need to do anything after change ‍‍.env

Resources