artisan

How to fix in laravel 5.2 zizaco entrust:migration class name validation?

喜你入骨 提交于 2019-12-03 03:24:18
I have followed zizac/entrust installation tutorial from GitHub Link and faced with error: Class name must be a valid object or a string in var/www/html/laravel_test/vendor/zizaco/entrust/src/commands/MigrationCommand.php on line 86 MigrationCommand.php file url : Link Outut: php artisan entrust:migration Tables: roles, role_user, permissions, permission_role A migration that creates 'roles', 'role_user', 'permissions', 'permission_role' tables will be created in database/migrations directory Proceed with the migration creation? [Yes|no] (yes/no) [yes]: yes Creating migration... PHP Fatal

Laravel 5 - Creating Artisan Command for Packages

眉间皱痕 提交于 2019-12-03 01:50:33
I have been following along http://laravel.com/docs/5.0/commands and able to create artisan command in Laravel 5. But, how can I create artisan command and package it to packages? You can and should register the package commands inside a service provider using $this->commands() in the register() method: namespace Vendor\Package; class MyServiceProvider extends ServiceProvider { protected $commands = [ 'Vendor\Package\Commands\MyCommand', 'Vendor\Package\Commands\FooCommand', 'Vendor\Package\Commands\BarCommand', ]; public function register(){ $this->commands($this->commands); } } In laravel 5

Artisan, creating tables in database

廉价感情. 提交于 2019-12-02 20:19:09
I am trying to create mysql tables in Laravel 5. I created a file in /project/database/migrations called users.php : [...] public function up() { Schema::create('users', function(Blueprint $table) { $table->increments('id'); $table->string('username'); $table->string('fullname'); $table->int('number'); $table->string('email')->unique(); $table->string('password', 60); $table->rememberToken(); $table->timestamps(); }); } [...] I then tried running these commands in the project -folder: $ php artisan migrate $ php artisan migrate:install $ php artisan migrate --pretend None of them return any

Laravel - Create automated CRUD?

主宰稳场 提交于 2019-12-02 14:35:40
Is Artisan got a tool for create the code of a CRUD automated in Laravel? I search information about it but all the options are with an external tool outside of Artisan. create the code of a CRUD No! But if you want the CRUD methods copied from a properly defined stub use php artisan make:controller EntityController -r where the -r flag means a resourceful controller for the model Entity with create , show , index , store , update , edit , and delete methods The methods uses the proper parameters and apply convenient Dependency Injection and are named according to Route::resource('Entity',

Use laravel on azure webapp

雨燕双飞 提交于 2019-12-02 12:50:16
问题 My project is developed with larval, then i am trying to use azure for web server. I am copying folder laravel in C:\inetpub\wwwroot\laravel5 . Next I run php artisan serve. Then I test on http://localhost:8000/index (test on remote websever). It's ok. But if I access my url for example http://bobdict.cloudapp.net/index , it say page not found. What is the problem? I am a newbie for this, sorry. 回答1: It seems you are using IIS to host your PHP application on Azure VM. As the entrance of

Use laravel on azure webapp

怎甘沉沦 提交于 2019-12-02 06:23:59
My project is developed with larval, then i am trying to use azure for web server. I am copying folder laravel in C:\inetpub\wwwroot\laravel5 . Next I run php artisan serve. Then I test on http://localhost:8000/index (test on remote websever). It's ok. But if I access my url for example http://bobdict.cloudapp.net/index , it say page not found. What is the problem? I am a newbie for this, sorry. It seems you are using IIS to host your PHP application on Azure VM. As the entrance of laravel application locates in public folder in the root directory of the application. You can test to browse

Set default 'host' value for `php artisan serve`

眉间皱痕 提交于 2019-12-02 02:17:54
问题 I am building a Laravel site, and want to test it on other devices as I build it (phone, ipad etc). As I understand it, the way to do this is to run php artisan serve --host=0.0.0.0 . My question is... is there a way to define a default value for the host, and set it to 0.0.0.0, so that I can simply run php artisan serve and it will automatically run on 0.0.0.0 ? 回答1: You can do next thing: php artisan make:command CustomServeCommand Then delete all from file and use this code: <?php

laravel automatically deletes server.php on php artisan serve

吃可爱长大的小学妹 提交于 2019-12-01 23:54:20
问题 I am using laravel 5.6 on windows environment using php 7.2, (installed with xampp).After installing laravel the 'php artisan serve' command work but automatically deletes the server.php file . 回答1: Just to avoid the answer to this getting buried, OP linked issue solution in the comment Link explaining issue and how to resolve User had Avast antivirus running and it incorrectly flagged server.php as a malicious file, adding an exception to Avast for that file resolved the issue. 回答2: Add the

Set default 'host' value for `php artisan serve`

元气小坏坏 提交于 2019-12-01 22:38:09
I am building a Laravel site, and want to test it on other devices as I build it (phone, ipad etc). As I understand it, the way to do this is to run php artisan serve --host=0.0.0.0 . My question is... is there a way to define a default value for the host, and set it to 0.0.0.0, so that I can simply run php artisan serve and it will automatically run on 0.0.0.0 ? You can do next thing: php artisan make:command CustomServeCommand Then delete all from file and use this code: <?php namespace App\Console\Commands; use Illuminate\Foundation\Console\ServeCommand; use Symfony\Component\Console\Input

laravel automatically deletes server.php on php artisan serve

只谈情不闲聊 提交于 2019-12-01 22:26:41
I am using laravel 5.6 on windows environment using php 7.2, (installed with xampp).After installing laravel the 'php artisan serve' command work but automatically deletes the server.php file . Just to avoid the answer to this getting buried, OP linked issue solution in the comment Link explaining issue and how to resolve User had Avast antivirus running and it incorrectly flagged server.php as a malicious file, adding an exception to Avast for that file resolved the issue. Add the server.php as exception for Avast. It seems that you have used Avast Antivirus in your system. It detects it as