fix psr2
This commit is contained in:
@@ -9,6 +9,6 @@ class AuthUserController extends Controller
|
|||||||
{
|
{
|
||||||
public function show()
|
public function show()
|
||||||
{
|
{
|
||||||
return New UserResource(auth()->user());
|
return new UserResource(auth()->user());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,17 +66,17 @@ class BookmarkController extends Controller
|
|||||||
$promise = $client->requestAsync('GET', $url);
|
$promise = $client->requestAsync('GET', $url);
|
||||||
$response = $promise->wait();
|
$response = $promise->wait();
|
||||||
$page = $response->getBody()->getContents();
|
$page = $response->getBody()->getContents();
|
||||||
preg_match("/\<title\>(.*)\<\/title\>/i",$page,$title);
|
preg_match("/\<title\>(.*)\<\/title\>/i", $page, $title);
|
||||||
$metas['title'] = $title[1];
|
$metas['title'] = $title[1];
|
||||||
|
|
||||||
|
|
||||||
preg_match('/\<link rel="[icon|appel-touch](.*)\"\>/i',$page,$favicon);
|
preg_match('/\<link rel="[icon|appel-touch](.*)\"\>/i', $page, $favicon);
|
||||||
if(isset($favicon[1])) {
|
if (isset($favicon[1])) {
|
||||||
preg_match('/href="(.*)/i',$favicon[1],$favicon);
|
preg_match('/href="(.*)/i', $favicon[1], $favicon);
|
||||||
$metas['favicon'] = $favicon[1];
|
$metas['favicon'] = $favicon[1];
|
||||||
|
|
||||||
preg_match('/http/', $metas['favicon'], $matches);
|
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'];
|
$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));
|
//dd($metas['favicon'], $matches, !isset($matches[1]), empty($matches));
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class EventCategoryController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function destroy(EventCategory $category)
|
public function destroy(EventCategory $category)
|
||||||
{
|
{
|
||||||
if(auth()->user()->isAdmin()) {
|
if (auth()->user()->isAdmin()) {
|
||||||
$category->delete();
|
$category->delete();
|
||||||
return response()->json([], 204);
|
return response()->json([], 204);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class ImageController extends Controller
|
|||||||
public function users(User $user)
|
public function users(User $user)
|
||||||
{
|
{
|
||||||
foreach (auth()->user()->images as $image) {
|
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));
|
File::delete(storage_path('app/public/'.$image->path));
|
||||||
auth()->user()->images()->where('id', $image->id)->delete();
|
auth()->user()->images()->where('id', $image->id)->delete();
|
||||||
}
|
}
|
||||||
@@ -39,7 +39,7 @@ class ImageController extends Controller
|
|||||||
public function memos(Memo $memo)
|
public function memos(Memo $memo)
|
||||||
{
|
{
|
||||||
foreach ($memo->images as $image) {
|
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));
|
File::delete(storage_path('app/public/'.$image->path));
|
||||||
$memo->images()->where('id', $image->id)->delete();
|
$memo->images()->where('id', $image->id)->delete();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user