Outils pour utilisateurs

Outils du site


devweb:laravel:upgrade (lu 11897 fois)

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
Prochaine révision Les deux révisions suivantes
devweb:laravel:upgrade [12-04-2021 10:06]
edmc73 créée
devweb:laravel:upgrade [09-08-2023 20:55]
edmc73
Ligne 1: Ligne 1:
 ====== Upgrade ====== ====== Upgrade ======
  
-===== Sur changement de version de php ======+===== passer de laravel 6 à 8 ======
  
 +Créons une nouvelle branch dans notre projet
 +  git checkout -b laravel-upgrade
 +  
 +Ajouter le dépôt de laravel
 +  git remote add laravel https://github.com/laravel/laravel.git
  
-  ErrorException in Builder.php line 876: +Récupérer les informations du dépôt 
-  compact(): Undefined variable: operator+  git fetch laravel
  
-  vi vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php+Merger la version 8.x 
 +  git merge laravel/8.x  
 +  fatal: refus de fusionner des historiques sans relation
  
-cherche  +  git merge --no-commit --allow-unrelated-histories laravel/8.x
-<code php> +
- 872     public function addWhereExistsQuery(Builder $query, $boolean = 'and', $not = false) +
- 873     { +
- 874         $type = $not ? 'NotExists' : 'Exists'; +
- 875 +
- 876         $this->wheres[] = compact('type', 'operator', 'query', 'boolean'); +
- 877 +
- 878         $this->addBinding($query->getBindings(), 'where'); +
- 879 +
- 880         return $this; +
- 881     } +
-</code> +
-et remplace +
-<code php> +
- 872     public function addWhereExistsQuery(Builder $query, $boolean = 'and', $not = false) +
- 873     { +
- 874         $type = $not ? 'NotExists' : 'Exists'; +
- 875 +
- 876         $this->wheres[] = compact('type', 'query', 'boolean'); +
- 877 +
- 878         $this->addBinding($query->getBindings(), 'where'); +
- 879 +
- 880         return $this; +
- 881     } +
-</code>+
  
 +Valider tous les conflits avec l'éditeur de votre choix, puis commitez le merge
  
-  ErrorException in Builder.php line 1231: +Si vous avez bien mis à jour le composer.json, lancer un composer update 
-  count(): Parameter must be an array or an object that implements Countable+  composer update
  
-  vi vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php+===== Voir les modifs faites entre 2 versions de laravel ===== 
 + 
 +Exemple des fichiers modifiés entre la version 6.x et 8.x de laravel 
 + 
 +https://github.com/laravel/laravel/compare/6.x...8.x
  
-cherche 
-<code php> 
-1222     protected function callScope(callable $scope, $parameters = []) 
-1223     { 
-1224         array_unshift($parameters, $this); 
-1225 
-1226         $query = $this->getQuery(); 
-1227 
-1228         // We will keep track of how many wheres are on the query before running the 
-1229         // scope so that we can properly group the added scope constraints in the 
-1230         // query as their own isolated nested where statement and avoid issues. 
-1231         $originalWhereCount = count($query->wheres); 
-1232 
-1233         $result = $scope(...array_values($parameters)) ?: $this; 
-1234 
-1235         if ($this->shouldNestWheresForScope($query, $originalWhereCount)) { 
-1236             $this->nestWheresForScope($query, $originalWhereCount); 
-1237         } 
-1238 
-1239         return $result; 
-1240     } 
-</code> 
-et remplace 
-<code php> 
-1222     protected function callScope(callable $scope, $parameters = []) 
-1223     { 
-1224         array_unshift($parameters, $this); 
-1225 
-1226         $query = $this->getQuery(); 
-1227 
-1228         // We will keep track of how many wheres are on the query before running the 
-1229         // scope so that we can properly group the added scope constraints in the 
-1230         // query as their own isolated nested where statement and avoid issues. 
-1231         $originalWhereCount = count((array)$query->wheres); 
-1232 
-1233         $result = $scope(...array_values($parameters)) ?: $this; 
-1234 
-1235         if ($this->shouldNestWheresForScope($query, $originalWhereCount)) { 
-1236             $this->nestWheresForScope($query, $originalWhereCount); 
-1237         } 
-1238 
-1239         return $result; 
-1240     } 
-</code> 
  
devweb/laravel/upgrade.txt · Dernière modification: 26-08-2023 23:58 de edmc73