This commit is contained in:
2020-08-09 17:37:16 +02:00
parent 644dbd9ea2
commit 2c054b9b79
4 changed files with 9 additions and 9 deletions

View File

@@ -9,6 +9,6 @@ class AuthUserController extends Controller
{
public function show()
{
return New UserResource(auth()->user());
return new UserResource(auth()->user());
}
}

View File

@@ -66,17 +66,17 @@ class BookmarkController extends Controller
$promise = $client->requestAsync('GET', $url);
$response = $promise->wait();
$page = $response->getBody()->getContents();
preg_match("/\<title\>(.*)\<\/title\>/i",$page,$title);
preg_match("/\<title\>(.*)\<\/title\>/i", $page, $title);
$metas['title'] = $title[1];
preg_match('/\<link rel="[icon|appel-touch](.*)\"\>/i',$page,$favicon);
if(isset($favicon[1])) {
preg_match('/href="(.*)/i',$favicon[1],$favicon);
preg_match('/\<link rel="[icon|appel-touch](.*)\"\>/i', $page, $favicon);
if (isset($favicon[1])) {
preg_match('/href="(.*)/i', $favicon[1], $favicon);
$metas['favicon'] = $favicon[1];
preg_match('/http/', $metas['favicon'], $matches);
if(empty($matches)) {
if (empty($matches)) {
$metas['favicon'] = parse_url($url, PHP_URL_SCHEME).'://'.parse_url($url, PHP_URL_HOST).$metas['favicon'];
}
//dd($metas['favicon'], $matches, !isset($matches[1]), empty($matches));

View File

@@ -75,7 +75,7 @@ class EventCategoryController extends Controller
*/
public function destroy(EventCategory $category)
{
if(auth()->user()->isAdmin()) {
if (auth()->user()->isAdmin()) {
$category->delete();
return response()->json([], 204);
} else {

View File

@@ -14,7 +14,7 @@ class ImageController extends Controller
public function users(User $user)
{
foreach (auth()->user()->images as $image) {
if(File::exists(storage_path('app/public/'.$image->path))) {
if (File::exists(storage_path('app/public/'.$image->path))) {
File::delete(storage_path('app/public/'.$image->path));
auth()->user()->images()->where('id', $image->id)->delete();
}
@@ -39,7 +39,7 @@ class ImageController extends Controller
public function memos(Memo $memo)
{
foreach ($memo->images as $image) {
if(File::exists(storage_path('app/public/'.$image->path))) {
if (File::exists(storage_path('app/public/'.$image->path))) {
File::delete(storage_path('app/public/'.$image->path));
$memo->images()->where('id', $image->id)->delete();
}