laravel

Composite keys laravel schema builder

我的未来我决定 提交于 2021-02-06 10:13:30
问题 I need two composite primary keys and only one should be AUTO INCREMENT what I tried so far: // first try Schema::create("kitchen", function($table) { $table->increments('id'); $table->integer('restaurant_id'); $table->primary(array('id', 'restaurant_id')); $table->string('name'); }); // second try Schema::create("kitchen", function($table) { $table->increments('id'); $table->integer('restaurant_id'); $table->primary('restaurant_id'); $table->string('name'); }); None works. Error message:

Laravel 3 Schema Table Column Collation

柔情痞子 提交于 2021-02-06 09:34:49
问题 I'm learning laravel, and I'm stuck on a simple process. I want the tables to be generated as UTF-8 but varchar and text fields are like latin-1. Schema section in guide did not help at all. I found this GitHub entry but it does not work neither (throws me errors). I have a schema like this: <?php class Create_Authors_Table { /** * Make changes to the database. * * @return void */ public function up() { Schema::create('authors',function($table){ //$table->charset('utf8'); //does not work //

laravel broadcasting for multiple guard

十年热恋 提交于 2021-02-06 09:32:06
问题 I have the below auth guards that is defined for my app admins , designers , customers and etc. the default guard is the designer guard . I want every guard to have his own private channel . So I am defining it in my channel.php with multiple entries for each like below Broadcast::channel('private.admins.{id}', function ($admin, $id) { Log::info($admin); //logging the admin }); But this is always binding with default guard class so my question is how do I tell that to use here Admin model . I

laravel broadcasting for multiple guard

為{幸葍}努か 提交于 2021-02-06 09:31:10
问题 I have the below auth guards that is defined for my app admins , designers , customers and etc. the default guard is the designer guard . I want every guard to have his own private channel . So I am defining it in my channel.php with multiple entries for each like below Broadcast::channel('private.admins.{id}', function ($admin, $id) { Log::info($admin); //logging the admin }); But this is always binding with default guard class so my question is how do I tell that to use here Admin model . I

laravel regex validation not working

核能气质少年 提交于 2021-02-06 09:14:40
问题 I've just started using laravel and I'm working on validating a textarea in one of my forms. The textarea is for the users bio and so I only want to allow letters, numbers, spaces and the following characters: , . ? ; : ' " - () ! / @ $ This is what I have $validator = Validator::make(Input::all(), array('bio' => array('regex:[a-zA-Z0-9 ,\.\?;:\'"-\(\)!/@\$]') ) ); I've been searching and trying a lot to get it to work but I just can't figure it out. Any help would be much appreciated. Thanks

laravel regex validation not working

拈花ヽ惹草 提交于 2021-02-06 09:06:11
问题 I've just started using laravel and I'm working on validating a textarea in one of my forms. The textarea is for the users bio and so I only want to allow letters, numbers, spaces and the following characters: , . ? ; : ' " - () ! / @ $ This is what I have $validator = Validator::make(Input::all(), array('bio' => array('regex:[a-zA-Z0-9 ,\.\?;:\'"-\(\)!/@\$]') ) ); I've been searching and trying a lot to get it to work but I just can't figure it out. Any help would be much appreciated. Thanks

How do I setup and use Laravel Scheduling on AWS Elastic Beanstalk?

风格不统一 提交于 2021-02-06 08:50:29
问题 Scenario As a fairly new user of Laravel and Elastic Beanstalk I soon found my self in the need to schedule operations, like most of us do. In the past I had always used simple crontab scheduling for this. So now I stood before a list of questions: How do I run Laravel code using crontab? How do I setup crontab in my Elastic Beanstalk environment? Finding the individual answers to these questions weren't that hard. Combining them and actually getting it all to work however turned out to be a

How do I setup and use Laravel Scheduling on AWS Elastic Beanstalk?

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-06 08:48:35
问题 Scenario As a fairly new user of Laravel and Elastic Beanstalk I soon found my self in the need to schedule operations, like most of us do. In the past I had always used simple crontab scheduling for this. So now I stood before a list of questions: How do I run Laravel code using crontab? How do I setup crontab in my Elastic Beanstalk environment? Finding the individual answers to these questions weren't that hard. Combining them and actually getting it all to work however turned out to be a

How to schedule Artisan commands in a package?

家住魔仙堡 提交于 2021-02-05 20:09:49
问题 I have a package that contains Artisan commands. I’ve registered these commands with Artisan via my service provider like so: /** * Register the application services. * * @return void */ public function register() { // Register Amazon Artisan commands $this->commands([ 'App\Marketplace\Amazon\Console\PostProductData', 'App\Marketplace\Amazon\Console\PostProductImages', 'App\Marketplace\Amazon\Console\PostProductInventory', 'App\Marketplace\Amazon\Console\PostProductPricing', ]); } However,

How to schedule Artisan commands in a package?

…衆ロ難τιáo~ 提交于 2021-02-05 20:09:38
问题 I have a package that contains Artisan commands. I’ve registered these commands with Artisan via my service provider like so: /** * Register the application services. * * @return void */ public function register() { // Register Amazon Artisan commands $this->commands([ 'App\Marketplace\Amazon\Console\PostProductData', 'App\Marketplace\Amazon\Console\PostProductImages', 'App\Marketplace\Amazon\Console\PostProductInventory', 'App\Marketplace\Amazon\Console\PostProductPricing', ]); } However,