Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel create migration view

class CreateCompaniesView extends Migration 
{
    public function up()
    {
        DB::statement("CREATE VIEW companiesView AS
                        SELECT *,
                        (
                            SELECT GROUP_CONCAT(DISTINCT id SEPARATOR ',')
                            FROM people AS p
                            WHERE p.company_id = c.id
                        ) AS person_ids
                        FROM companies AS c");
    }
    public function down()
    {
        DB::statement("DROP VIEW companiesView");
    }
}
Comment

PREVIOUS NEXT
Code Example
Php :: POP UP WITH PHP FUNCTION 
Php :: php mysql error 
Php :: php get prameter 
Php :: laravel sidebar menu active 
Php :: write file in php 
Php :: get http code curl php 
Php :: Turning a StdClass object into an array 
Php :: laravel run local to all land networks 
Php :: add array to another array in laravel collection 
Php :: laravel model db raw count 
Php :: php convert number to month 
Php :: laravel blade @guest 
Php :: is alphanumeric php 
Php :: generate token in php 
Php :: php make array to certain length 
Php :: SSL PHP CURL 
Php :: Composer detected issues in your platform: Your Composer dependencies require a PHP version "= 8.0.2". 
Php :: php from 
Php :: convert object to array laravel 
Php :: Get Parameters From a URL String in PHP 
Php :: run raw sql with doctrine manager 
Php :: counting time execution duration in time laravel 
Php :: php serialize 
Php :: group in route in laravel 
Php :: php get index of current item array_reduce 
Php :: how to request user input in php 
Php :: laravel timestamps on pivot table 
Php :: non negative integer validation laravel 
Php :: array to string conversion in php 
Php :: php key value dictionary 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =