combine two query value in laravel 8
// get all film projects
$filmProjects= FilmProject::all();
// get all new media projects
$newMediaProjects= NewMediaProject::all();
// merge projects,
foreach($filmProjects as $filmProject) {
$newMediaProjects->add($filmProject);
}
// or we can also do this $newMediaProjects->toBase()->merge($filmProjects);
dd($newMediaProjects->toArray());
Also in PHP:
- afficher type et contenu d'une variable php
- error reporting php
- add 1 day to the some date
- How to create WordPress users programmatically
- Max character count for string in php
- Fatal error: Uncaught ReflectionException: Class config does not exist in
- convert space to 20 php
- creade seeder in laravel
- file list php page
- Fixes duplicate arrays to show a single character. php
- check php version linux terminal
- datetime format php datetime
- check if key is in array php
- check if some character exists in string php
- error reporting set 0 in php
- PHP string mask day-year
- echo foreach
- drupal/core 8.9.7 requires ext-dom * -> the requested PHP extension dom is missing from your system. composer install
- find days with name between two dates in php
- create random unique password with php
- $pdo= new PDO(
- composer require guzzlehttp/guzzle
- cache clear of app.php laravel
- executer page php via boutton