getSize() > 5000000) { return false; } } } return true; }); //Add tags for notes Note::created(function ($note) { $tagsToAdd = []; preg_match_all('/#([^\s<>]+)\b/', $note, $tags); foreach ($tags[1] as $tag) { $tag = Tag::normalizeTag($tag); } $tags = array_unique($tags[1]); foreach ($tags as $tag) { $tag = Tag::firstOrCreate(['tag' => $tag]); $tagsToAdd[] = $tag->id; } if (count($tagsToAdd > 0)) { $note->tags()->attach($tagsToAdd); } }); //allow micropub use in development if (env('APP_DEBUG') == true) { session(['me' => env('APP_URL')]); if (Storage::exists('dev-token')) { session(['token' => Storage::get('dev-token')]); } } } /** * Register any application services. * * @return void */ public function register() { // } }