You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,15 +37,15 @@ By default Laravel does not allow to generate observers or even does not allow t
37
37
Open the console and enter this command to generate a new repository :
38
38
39
39
```shell
40
-
php artisan laravel:repository {Entity}
40
+
php artisan make:repository {Entity}
41
41
```
42
42
43
43
The generate file look like this :
44
44
45
45
```php
46
46
namespace App\Repositories;
47
47
48
-
use App\Entity;
48
+
use App\Models\Entity;
49
49
50
50
class EntityRepository
51
51
{
@@ -75,24 +75,24 @@ class EntityRepository
75
75
}
76
76
```
77
77
78
-
By default Repository load Model in the default application namespace `App\` If your models are in another namespace, it will be necessary to change the use in the repository to have no error like :
78
+
By default Repository load Model in the default application namespace `App\Models` If your models are in another namespace, it will be necessary to change the use in the repository to have no error like :
79
79
80
80
```php
81
81
use MODELS\NAMESPACE\Entity;
82
82
```
83
83
84
-
This is the same action to perform for the observers, it also loads the models in the default namespace App\. To generate an observer, you must execute the command:
84
+
This is the same action to perform for the observers, it also loads the models in the namespace App\Models. To generate an observer, you must execute the command:
85
85
86
86
```shell
87
-
php artisan laravel:observer {Entity}
87
+
php artisan make:observer {Entity}
88
88
```
89
89
90
90
The generate file look like this :
91
91
92
92
```php
93
93
namespace App\Observers;
94
94
95
-
use App\Entity;
95
+
use App\Models\Entity;
96
96
97
97
class EntityObserver
98
98
{
@@ -125,7 +125,7 @@ class EntityObserver
125
125
- Helper files
126
126
127
127
```bash
128
-
$ php artisan laravel:helper {Entity}
128
+
$ php artisan make:helper {Entity}
129
129
```
130
130
131
131
The generate file look like this :
@@ -188,18 +188,18 @@ class MediaHelper
188
188
/**
189
189
* resize, To rezise and image
190
190
*
191
-
* @param string $file,l'image à redimmensionner
192
-
* @param int $width,la largeur à laquelle on doit redimensionner l'image
193
-
* @param int $height,la hateur à laquelle on doit redimensionner l'image
194
-
* @param string $filepath, le chemin ou est garder le fichier redimensionner
191
+
* @param string $file file to rezise
192
+
* @param int $width width of the file
193
+
* @param int $height height of the file
194
+
* @param string $filepath path to save file
195
195
*/
196
196
public static function resize($file, $width, $height, $filepath)
0 commit comments