Skip to content
This repository was archived by the owner on Mar 13, 2023. It is now read-only.

Commit cb394b8

Browse files
committed
Merge branch 'dev' of github.com:laravelcm/website into dev
2 parents a6ee9ac + bf0f8ed commit cb394b8

File tree

614 files changed

+941
-105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

614 files changed

+941
-105
lines changed

.editorconfig

100644100755
File mode changed.

.env.example

100644100755
File mode changed.

.gitattributes

100644100755
File mode changed.

.gitignore

100644100755
File mode changed.

app/Console/Kernel.php

100644100755
File mode changed.

app/Exceptions/Handler.php

100644100755
File mode changed.

app/Helpers/MediaHelper.php

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?php
2+
/**
3+
* @copyright Copyright (c) 2018. MckenzieArts
4+
* @author Mckenziearts <[email protected]>
5+
* @link https://www.camer-freelancer.com
6+
* @since 7.1
7+
* @version 1.0
8+
* @package CF/Helpers
9+
*/
10+
11+
namespace App\Helpers;
12+
13+
use Intervention\Image\Facades\Image;
14+
15+
class MediaHelper
16+
{
17+
/**
18+
* @protected
19+
*
20+
* @var string $dir, the file uploaded path
21+
*/
22+
protected static $dir = 'app/public';
23+
24+
/**
25+
* @return string
26+
*/
27+
public static function getUploadsFolder()
28+
{
29+
return self::$dir;
30+
}
31+
32+
/**
33+
* @return string
34+
*/
35+
public static function getStoragePath()
36+
{
37+
return storage_path(self::$dir);
38+
}
39+
40+
/**
41+
* Return the size of an image
42+
*
43+
* @param string $file
44+
* @param string $folder
45+
* @return array $width and $height of the file give in parameter
46+
*/
47+
public static function getFileSizes(string $file, string $folder = null)
48+
{
49+
if ($folder) {
50+
list($width, $height, $type, $attr) = getimagesize(storage_path(self::$dir.'/'. $folder .'/'. date('FY') .'/'.$file));
51+
}
52+
list($width, $height, $type, $attr) = getimagesize(storage_path(self::$dir.'/'. date('FY') .'/'.$file));
53+
54+
return [
55+
'width' => $width,
56+
'height' => $height
57+
];
58+
}
59+
60+
/**
61+
* resize, To rezise and image
62+
*
63+
* @param string $file, l'image à redimmensionner
64+
* @param int $width, la largeur à laquelle on doit redimensionner l'image
65+
* @param int $height, la hateur à laquelle on doit redimensionner l'image
66+
* @param string $filepath, le chemin ou est garder le fichier redimensionner
67+
*/
68+
public static function resize($file, $width, $height, $filepath)
69+
{
70+
Image::make($file)->resize($width, $height)->save($filepath);
71+
}
72+
73+
/**
74+
* getImageWeight, permet de retourner le poids d'une image
75+
*
76+
* @param $octets
77+
* @return string
78+
*/
79+
public static function getImageWeight($octets) {
80+
$resultat = $octets;
81+
for ($i = 0; $i < 8 && $resultat >= 1024; $i++) {
82+
$resultat = $resultat / 1024;
83+
}
84+
if ($i > 0) {
85+
return preg_replace('/,00$/', '', number_format($resultat, 2, ',', ''))
86+
. ' ' . substr('KMGTPEZY', $i-1, 1) . 'o';
87+
} else {
88+
return $resultat . ' o';
89+
}
90+
}
91+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Admin;
4+
5+
use Illuminate\Http\Request;
6+
use TCG\Voyager\Http\Controllers\VoyagerBaseController as BaseVoyagerBaseController;
7+
8+
class ChatterCategoryController extends BaseVoyagerBaseController
9+
{
10+
//
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Admin;
4+
5+
use Illuminate\Http\Request;
6+
use App\Http\Controllers\Controller;
7+
8+
class ChatterDiscussionController extends Controller
9+
{
10+
//
11+
}

app/Http/Controllers/Auth/ForgotPasswordController.php

100644100755
File mode changed.

0 commit comments

Comments
 (0)