forked from eatvio/eatvio-infra
refactoring: folowing phpinsights recomendations
This commit is contained in:
@@ -68,7 +68,7 @@ jobs:
|
||||
# run: vendor/bin/pint
|
||||
|
||||
- name: Run PHP Insides
|
||||
run: vendor/bin/phpinsights --no-interaction --min-quality=80 --min-complexity=90 --min-architecture=75 --min-style=95
|
||||
run: vendor/bin/phpinsights --config-path=./config/insights.php --no-interaction --min-quality=80 --min-complexity=90 --min-architecture=75 --min-style=95
|
||||
|
||||
- name: Run Static Analysis
|
||||
run: composer static-analysis
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use App\Models\Recipe;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class UpdateSlugs extends Command
|
||||
{
|
||||
@@ -30,7 +30,7 @@ class UpdateSlugs extends Command
|
||||
->get()
|
||||
->each(
|
||||
function ($model) {
|
||||
$newName = $model->title . " 2612";
|
||||
$newName = $model->title . ' 2612';
|
||||
$oldName = Str::replaceLast(' 2612', '', $newName);
|
||||
|
||||
$model->title = $newName;
|
||||
@@ -40,6 +40,5 @@ class UpdateSlugs extends Command
|
||||
$model->save();
|
||||
}
|
||||
);
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,6 +119,7 @@ class ChatController extends Controller
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\Models\Chat $chat
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(int $lastChatUser)
|
||||
|
||||
@@ -38,6 +38,7 @@ class ConsultantController extends Controller
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
@@ -48,6 +49,7 @@ class ConsultantController extends Controller
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
@@ -58,6 +60,7 @@ class ConsultantController extends Controller
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
@@ -68,6 +71,7 @@ class ConsultantController extends Controller
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
|
||||
@@ -89,6 +89,7 @@ class ConsultantDiaryCommentController extends Controller
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Models\Diary $consultantDiaryComment
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(Diary $diary)
|
||||
|
||||
@@ -45,6 +45,7 @@ class DiaryController extends Controller
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Diary $diary)
|
||||
@@ -59,6 +60,7 @@ class DiaryController extends Controller
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
@@ -80,6 +82,7 @@ class DiaryController extends Controller
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
@@ -99,6 +102,7 @@ class DiaryController extends Controller
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
|
||||
@@ -41,6 +41,7 @@ class FeedController extends Controller
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
@@ -51,6 +52,7 @@ class FeedController extends Controller
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
@@ -61,6 +63,7 @@ class FeedController extends Controller
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
@@ -71,6 +74,7 @@ class FeedController extends Controller
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
|
||||
@@ -38,6 +38,7 @@ class UserDetailzController extends Controller
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\Models\User $user
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(UserDetailz $userDetailz)
|
||||
|
||||
@@ -10,6 +10,7 @@ class Authenticate extends Middleware
|
||||
* Get the path the user should be redirected to when they are not authenticated.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
protected function redirectTo($request)
|
||||
|
||||
@@ -14,6 +14,7 @@ class RedirectIfAuthenticated
|
||||
*
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
|
||||
* @param string|null ...$guards
|
||||
*
|
||||
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function handle(Request $request, Closure $next, ...$guards)
|
||||
|
||||
@@ -48,36 +48,6 @@ class Create extends Component
|
||||
|
||||
public $isVisibleState = false;
|
||||
|
||||
protected function rules()
|
||||
{
|
||||
$rules = [
|
||||
'name' => 'required|min:3',
|
||||
'image' => 'required|image|max:2048',
|
||||
'duration' => 'required|numeric|min:7',
|
||||
'state' => 'required|in:draft,active,unactive',
|
||||
'type' => ['required', 'array:slim,fit,wellness,behavior', 'min:1'],
|
||||
'details' => 'required|min:3',
|
||||
'packets_count' => 'required|in:1,3',
|
||||
'packet1_options.short' => 'required|string|min:3',
|
||||
'packet1_options.price' => 'required|numeric|min:1',
|
||||
'packet1_options.description' => 'required|string|min:3',
|
||||
'packet1_options.items' => 'required|array|min:1',
|
||||
];
|
||||
|
||||
if ($this->packets_count === 3) {
|
||||
$rules['packet2_options.short'] = 'required|string|min:3';
|
||||
$rules['packet2_options.price'] = 'required|numeric|min:1';
|
||||
$rules['packet2_options.description'] = 'required|string|min:3';
|
||||
$rules['packet2_options.items'] = 'required|array|min:1';
|
||||
$rules['packet3_options.short'] = 'required|string|min:3';
|
||||
$rules['packet3_options.price'] = 'required|numeric|min:1';
|
||||
$rules['packet3_options.description'] = 'required|string|min:3';
|
||||
$rules['packet3_options.items'] = 'required|array|min:1';
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.plan.create');
|
||||
@@ -157,4 +127,34 @@ class Create extends Component
|
||||
$this->state = 'unactive';
|
||||
$this->publish();
|
||||
}
|
||||
|
||||
protected function rules()
|
||||
{
|
||||
$rules = [
|
||||
'name' => 'required|min:3',
|
||||
'image' => 'required|image|max:2048',
|
||||
'duration' => 'required|numeric|min:7',
|
||||
'state' => 'required|in:draft,active,unactive',
|
||||
'type' => ['required', 'array:slim,fit,wellness,behavior', 'min:1'],
|
||||
'details' => 'required|min:3',
|
||||
'packets_count' => 'required|in:1,3',
|
||||
'packet1_options.short' => 'required|string|min:3',
|
||||
'packet1_options.price' => 'required|numeric|min:1',
|
||||
'packet1_options.description' => 'required|string|min:3',
|
||||
'packet1_options.items' => 'required|array|min:1',
|
||||
];
|
||||
|
||||
if ($this->packets_count === 3) {
|
||||
$rules['packet2_options.short'] = 'required|string|min:3';
|
||||
$rules['packet2_options.price'] = 'required|numeric|min:1';
|
||||
$rules['packet2_options.description'] = 'required|string|min:3';
|
||||
$rules['packet2_options.items'] = 'required|array|min:1';
|
||||
$rules['packet3_options.short'] = 'required|string|min:3';
|
||||
$rules['packet3_options.price'] = 'required|numeric|min:1';
|
||||
$rules['packet3_options.description'] = 'required|string|min:3';
|
||||
$rules['packet3_options.items'] = 'required|array|min:1';
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,6 @@ class Edit extends Component
|
||||
$this->packet1_options['items'] = $plan->packet1_options['items'];
|
||||
|
||||
if ($plan->packets_count === 3) {
|
||||
|
||||
$this->packet2_options_input['short'] = $plan->packet2_options['short'];
|
||||
$this->packet2_options_input['price'] = $plan->packet2_options['price'];
|
||||
$this->packet2_options_input['description'] = $plan->packet2_options['description'];
|
||||
@@ -97,36 +96,6 @@ class Edit extends Component
|
||||
// commentsCount
|
||||
}
|
||||
|
||||
protected function rules()
|
||||
{
|
||||
$rules = [
|
||||
'name' => 'required|min:3',
|
||||
// 'image' => 'image|max:2048',
|
||||
'duration' => 'required|numeric|min:7',
|
||||
'state' => 'required|in:draft,active,unactive',
|
||||
'type' => ['required', 'array:slim,fit,wellness,behavior', 'min:1'],
|
||||
'details' => 'required|min:3',
|
||||
'packets_count' => 'required|in:1,3',
|
||||
'packet1_options.short' => 'required|string|min:3',
|
||||
'packet1_options.price' => 'required|numeric|min:1',
|
||||
'packet1_options.description' => 'required|string|min:3',
|
||||
'packet1_options.items' => 'required|array|min:1',
|
||||
];
|
||||
|
||||
if ($this->packets_count === 3) {
|
||||
$rules['packet2_options.short'] = 'required|string|min:3';
|
||||
$rules['packet2_options.price'] = 'required|numeric|min:1';
|
||||
$rules['packet2_options.description'] = 'required|string|min:3';
|
||||
$rules['packet2_options.items'] = 'required|array|min:1';
|
||||
$rules['packet3_options.short'] = 'required|string|min:3';
|
||||
$rules['packet3_options.price'] = 'required|numeric|min:1';
|
||||
$rules['packet3_options.description'] = 'required|string|min:3';
|
||||
$rules['packet3_options.items'] = 'required|array|min:1';
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
public function showListDuration()
|
||||
{
|
||||
$this->isVisibleDuration = ! $this->isVisibleDuration;
|
||||
@@ -205,4 +174,34 @@ class Edit extends Component
|
||||
{
|
||||
return view('livewire.plan.edit');
|
||||
}
|
||||
|
||||
protected function rules()
|
||||
{
|
||||
$rules = [
|
||||
'name' => 'required|min:3',
|
||||
// 'image' => 'image|max:2048',
|
||||
'duration' => 'required|numeric|min:7',
|
||||
'state' => 'required|in:draft,active,unactive',
|
||||
'type' => ['required', 'array:slim,fit,wellness,behavior', 'min:1'],
|
||||
'details' => 'required|min:3',
|
||||
'packets_count' => 'required|in:1,3',
|
||||
'packet1_options.short' => 'required|string|min:3',
|
||||
'packet1_options.price' => 'required|numeric|min:1',
|
||||
'packet1_options.description' => 'required|string|min:3',
|
||||
'packet1_options.items' => 'required|array|min:1',
|
||||
];
|
||||
|
||||
if ($this->packets_count === 3) {
|
||||
$rules['packet2_options.short'] = 'required|string|min:3';
|
||||
$rules['packet2_options.price'] = 'required|numeric|min:1';
|
||||
$rules['packet2_options.description'] = 'required|string|min:3';
|
||||
$rules['packet2_options.items'] = 'required|array|min:1';
|
||||
$rules['packet3_options.short'] = 'required|string|min:3';
|
||||
$rules['packet3_options.price'] = 'required|numeric|min:1';
|
||||
$rules['packet3_options.description'] = 'required|string|min:3';
|
||||
$rules['packet3_options.items'] = 'required|array|min:1';
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace App\Livewire\Plan;
|
||||
|
||||
use App\Models\Plan;
|
||||
use Livewire\Attributes\On;
|
||||
use Livewire\Component;
|
||||
|
||||
class LikeCount extends Component
|
||||
|
||||
@@ -26,7 +26,7 @@ class Create extends Component
|
||||
|
||||
public function toggle()
|
||||
{
|
||||
$this->isChecked = !$this->isChecked;
|
||||
$this->isChecked = ! $this->isChecked;
|
||||
}
|
||||
|
||||
public function save()
|
||||
|
||||
@@ -20,7 +20,7 @@ class Show extends Component
|
||||
|
||||
public function toggleTabpanelState($tabpanelName)
|
||||
{
|
||||
collect($this->tabpanelState)->keys()->map(fn($key) => $key === $tabpanelName
|
||||
collect($this->tabpanelState)->keys()->map(fn ($key) => $key === $tabpanelName
|
||||
? $this->tabpanelState[$tabpanelName] = $tabpanelName
|
||||
: $this->tabpanelState[$key] = false, array_keys($this->tabpanelState));
|
||||
}
|
||||
|
||||
@@ -47,11 +47,9 @@ class Create extends Component
|
||||
|
||||
protected $listeners = ['stepRemoved' => '$refresh'];
|
||||
|
||||
|
||||
|
||||
public function toggleStateRow(string $currentRow): void
|
||||
{
|
||||
collect($this->state_row)->keys()->map(fn($key) => $key === $currentRow
|
||||
collect($this->state_row)->keys()->map(fn ($key) => $key === $currentRow
|
||||
? $this->state_row[$currentRow] = 'true'
|
||||
: $this->state_row[$key] = 'false');
|
||||
}
|
||||
@@ -104,7 +102,7 @@ class Create extends Component
|
||||
public function parentComponentTagRemoved($tag)
|
||||
{
|
||||
$this->tags = collect($this->tags)
|
||||
->filter(fn($curTag) => $curTag['name'] !== $tag)
|
||||
->filter(fn ($curTag) => $curTag['name'] !== $tag)
|
||||
->all();
|
||||
}
|
||||
|
||||
@@ -122,21 +120,8 @@ class Create extends Component
|
||||
$this->publish();
|
||||
}
|
||||
|
||||
protected function rules()
|
||||
{
|
||||
return [
|
||||
'image' => 'required|image|max:2048',
|
||||
'state' => 'required|in:active,archived',
|
||||
'description' => 'required|min:3',
|
||||
'type' => 'required|min:3',
|
||||
'video_url' => 'nullable|url|max:2048',
|
||||
'cooking_time' => 'nullable|numeric',
|
||||
];
|
||||
}
|
||||
|
||||
public function publish()
|
||||
{
|
||||
|
||||
$this->validate();
|
||||
|
||||
$recipe = new Recipe();
|
||||
@@ -151,7 +136,7 @@ class Create extends Component
|
||||
$recipe->ingredients = $this->ingredients;
|
||||
$recipe->save();
|
||||
|
||||
$tagsIds = collect($this->tags)->map(fn($curTag) => $curTag['id']);
|
||||
$tagsIds = collect($this->tags)->map(fn ($curTag) => $curTag['id']);
|
||||
$recipe->tags()->attach($tagsIds);
|
||||
|
||||
$user = Auth::user();
|
||||
@@ -160,6 +145,23 @@ class Create extends Component
|
||||
$this->redirectRoute('recipe.show', $recipe);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.recipe.create');
|
||||
}
|
||||
|
||||
protected function rules()
|
||||
{
|
||||
return [
|
||||
'image' => 'required|image|max:2048',
|
||||
'state' => 'required|in:active,archived',
|
||||
'description' => 'required|min:3',
|
||||
'type' => 'required|min:3',
|
||||
'video_url' => 'nullable|url|max:2048',
|
||||
'cooking_time' => 'nullable|numeric',
|
||||
];
|
||||
}
|
||||
|
||||
private function transformSteps($steps)
|
||||
{
|
||||
return collect($steps)->map(
|
||||
@@ -167,7 +169,7 @@ class Create extends Component
|
||||
if (gettype($step['image']) === 'string') {
|
||||
$data['image'] = $step['image'];
|
||||
} else {
|
||||
$data['image'] = !is_null($step['image']) ? $step['image']->store('steps', 'public') : '';
|
||||
$data['image'] = ! is_null($step['image']) ? $step['image']->store('steps', 'public') : '';
|
||||
}
|
||||
|
||||
$data['description'] = $step['description'];
|
||||
@@ -176,12 +178,4 @@ class Create extends Component
|
||||
}
|
||||
)->toArray();
|
||||
}
|
||||
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.recipe.create');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ class Edit extends Component
|
||||
|
||||
public function toggleStateRow(string $currentRow): void
|
||||
{
|
||||
collect($this->state_row)->keys()->map(fn($key) => $key === $currentRow
|
||||
collect($this->state_row)->keys()->map(fn ($key) => $key === $currentRow
|
||||
? $this->state_row[$currentRow] = 'true'
|
||||
: $this->state_row[$key] = 'false');
|
||||
}
|
||||
@@ -122,19 +122,6 @@ class Edit extends Component
|
||||
$this->recipe->tags()->detach($selectedTags);
|
||||
}
|
||||
|
||||
protected function rules()
|
||||
{
|
||||
return [
|
||||
'image' => 'filled',
|
||||
'state' => 'required|in:active,archived',
|
||||
'description' => 'required|min:3',
|
||||
'type' => 'required|min:3',
|
||||
'video_url' => 'nullable|url|max:2048',
|
||||
'cooking_time' => 'nullable|numeric',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function draft()
|
||||
{
|
||||
$this->state = 'archived';
|
||||
@@ -170,6 +157,23 @@ class Edit extends Component
|
||||
$this->redirectRoute('recipe.show', $recipe);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.recipe.edit');
|
||||
}
|
||||
|
||||
protected function rules()
|
||||
{
|
||||
return [
|
||||
'image' => 'filled',
|
||||
'state' => 'required|in:active,archived',
|
||||
'description' => 'required|min:3',
|
||||
'type' => 'required|min:3',
|
||||
'video_url' => 'nullable|url|max:2048',
|
||||
'cooking_time' => 'nullable|numeric',
|
||||
];
|
||||
}
|
||||
|
||||
private function transformSteps($steps)
|
||||
{
|
||||
return collect($steps)->
|
||||
@@ -184,11 +188,4 @@ class Edit extends Component
|
||||
return $data;
|
||||
})->toArray();
|
||||
}
|
||||
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.recipe.edit');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,6 +21,20 @@ class Plan extends Model implements Viewable
|
||||
use InteractsWithViews;
|
||||
use PresentableTrait;
|
||||
|
||||
protected $withCount = [
|
||||
'likes',
|
||||
'comments',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'type' => 'array',
|
||||
'packet1_options' => 'array',
|
||||
'packet2_options' => 'array',
|
||||
'packet3_options' => 'array',
|
||||
];
|
||||
|
||||
protected $presenter = PlanPresenter::class;
|
||||
|
||||
public function getSlugOptions(): SlugOptions
|
||||
{
|
||||
return SlugOptions::create()
|
||||
@@ -42,20 +56,6 @@ class Plan extends Model implements Viewable
|
||||
return 'slug';
|
||||
}
|
||||
|
||||
protected $withCount = [
|
||||
'likes',
|
||||
'comments',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'type' => 'array',
|
||||
'packet1_options' => 'array',
|
||||
'packet2_options' => 'array',
|
||||
'packet3_options' => 'array',
|
||||
];
|
||||
|
||||
protected $presenter = PlanPresenter::class;
|
||||
|
||||
public function author()
|
||||
{
|
||||
return $this->belongsToMany(User::class, 'plan_author', 'plan_id', 'user_id');
|
||||
|
||||
@@ -4,12 +4,12 @@ namespace App\Models;
|
||||
|
||||
use CyrildeWit\EloquentViewable\Contracts\Viewable;
|
||||
use CyrildeWit\EloquentViewable\InteractsWithViews;
|
||||
use Illuminate\Contracts\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Casts\AsCollection;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOneThrough;
|
||||
use Illuminate\Contracts\Database\Eloquent\Builder;
|
||||
use Spatie\Sluggable\HasSlug;
|
||||
use Spatie\Sluggable\SlugOptions;
|
||||
|
||||
@@ -83,7 +83,6 @@ class Recipe extends Model implements Viewable
|
||||
return $this->hasMany(RecipeLike::class);
|
||||
}
|
||||
|
||||
|
||||
public function scopeNegativeComments(Builder $query)
|
||||
{
|
||||
return static::comments()->where('grade', '<=', '3');
|
||||
|
||||
@@ -28,6 +28,7 @@ class DietStarted extends Notification implements ShouldQueue
|
||||
* Get the notification's delivery channels.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function via($notifiable)
|
||||
@@ -39,6 +40,7 @@ class DietStarted extends Notification implements ShouldQueue
|
||||
* Get the mail representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return \Illuminate\Notifications\Messages\MailMessage
|
||||
*/
|
||||
public function toMail($notifiable)
|
||||
@@ -53,6 +55,7 @@ class DietStarted extends Notification implements ShouldQueue
|
||||
* Get the array representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($notifiable)
|
||||
|
||||
@@ -65,6 +65,7 @@ return [
|
||||
*/
|
||||
|
||||
'exclude' => [
|
||||
'/application/app/Livewire',
|
||||
// 'path/to/directory-or-file'
|
||||
],
|
||||
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
<?php
|
||||
|
||||
// use Rector\Nette\Set\NetteSetList;
|
||||
use Rector\Set\ValueObject\SetList;
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Set\ValueObject\LevelSetList;
|
||||
use Rector\Set\ValueObject\SetList;
|
||||
use RectorLaravel\Set\LaravelSetList;
|
||||
|
||||
return function (RectorConfig $rectorConfig): void {
|
||||
|
||||
$rectorConfig->paths([
|
||||
__DIR__ . '/app',
|
||||
__DIR__ . '/bootstrap',
|
||||
@@ -26,4 +24,3 @@ return function (RectorConfig $rectorConfig): void {
|
||||
// $rectorConfig->import(LevelSetList::UP_TO_PHP_82);
|
||||
$rectorConfig->import(LaravelSetList::LARAVEL_100);
|
||||
};
|
||||
|
||||
|
||||
117
routes/web.php
117
routes/web.php
@@ -65,9 +65,20 @@ Route::group(
|
||||
[RegistrationStartController::class, 'start']
|
||||
)->name('register.start');
|
||||
|
||||
Route::get('/registration/{step}', Registration\Step1::class)->name('register.step1');
|
||||
Route::get('/plan/', [PlanController::class,'index'])->name('plan.index');
|
||||
Route::get('/recipe/', [RecipeController::class,'index'])->name('recipe.index');
|
||||
Route::get(
|
||||
'/registration/{step}',
|
||||
Registration\Step1::class
|
||||
)->name('register.step1');
|
||||
|
||||
Route::get(
|
||||
'/plan/',
|
||||
[PlanController::class,'index']
|
||||
)->name('plan.index');
|
||||
|
||||
Route::get(
|
||||
'/recipe/',
|
||||
[RecipeController::class,'index']
|
||||
)->name('recipe.index');
|
||||
|
||||
Route::middleware(
|
||||
[
|
||||
@@ -85,34 +96,92 @@ Route::group(
|
||||
)->name('dashboard');
|
||||
Route::resource('profile', ProfileController::class)->parameters(['profile' => 'user']);
|
||||
Route::get('/feed', [FeedController::class, 'index'])->name('news_feed');
|
||||
Route::resource('chat', ChatController::class)->only(['index', 'create', 'show']);
|
||||
Route::resource('diary', DiaryController::class);
|
||||
Route::resource('calendar', CalendarController::class);
|
||||
Route::resource('user_detailz', UserDetailzController::class);
|
||||
Route::resource('user', UserController::class)->only('show');
|
||||
Route::resource('finance', FinanceController::class)->only(['index', 'show']);
|
||||
Route::resource('plan', PlanController::class)->only(['create', 'edit']);
|
||||
Route::resource('diet', DietController::class)->only(['create', 'show', 'index', 'edit']);
|
||||
Route::resource('consultants', ConsultantController::class)->only(['index']);
|
||||
Route::resource('recipe', RecipeController::class)->only(['create', 'edit']);
|
||||
Route::resource('blog_post', BlogPostController::class)->only(['create', 'show', 'index', 'edit']);
|
||||
Route::resource('product_nutritional_value', ProductNutritionalValueController::class)->only(['create', 'show', 'index', 'edit']);
|
||||
Route::resource('consultant_request', ConsultantRequestFormController::class)
|
||||
Route::resource(
|
||||
'chat',
|
||||
ChatController::class
|
||||
)->only(['index', 'create', 'show']);
|
||||
|
||||
Route::resource(
|
||||
'diary',
|
||||
DiaryController::class
|
||||
);
|
||||
|
||||
Route::resource(
|
||||
'calendar',
|
||||
CalendarController::class
|
||||
);
|
||||
|
||||
Route::resource(
|
||||
'user_detailz',
|
||||
UserDetailzController::class
|
||||
);
|
||||
|
||||
Route::resource(
|
||||
'user',
|
||||
UserController::class
|
||||
)->only('show');
|
||||
|
||||
Route::resource(
|
||||
'finance',
|
||||
FinanceController::class
|
||||
)->only(['index', 'show']);
|
||||
|
||||
Route::resource(
|
||||
'plan',
|
||||
PlanController::class
|
||||
)->only(['create', 'edit']);
|
||||
|
||||
Route::resource(
|
||||
'diet',
|
||||
DietController::class
|
||||
)->only(['create', 'show', 'index', 'edit']);
|
||||
|
||||
Route::resource(
|
||||
'consultants',
|
||||
ConsultantController::class
|
||||
)->only(['index']);
|
||||
|
||||
Route::resource(
|
||||
'recipe',
|
||||
RecipeController::class
|
||||
)->only(['create', 'edit']);
|
||||
|
||||
Route::resource(
|
||||
'blog_post',
|
||||
BlogPostController::class
|
||||
)->only(['create', 'show', 'index', 'edit']);
|
||||
|
||||
Route::resource(
|
||||
'product_nutritional_value',
|
||||
ProductNutritionalValueController::class
|
||||
)->only(['create', 'show', 'index', 'edit']);
|
||||
|
||||
Route::resource(
|
||||
'consultant_request',
|
||||
ConsultantRequestFormController::class
|
||||
)
|
||||
->parameters(
|
||||
[
|
||||
'consultant_request' => 'user',
|
||||
]
|
||||
);
|
||||
Route::resource('consultant_diary_comment', ConsultantDiaryCommentController::class)
|
||||
->parameters(
|
||||
[
|
||||
'consultant_diary_comment' => 'diary',
|
||||
]
|
||||
);
|
||||
|
||||
Route::resource(
|
||||
'consultant_diary_comment',
|
||||
ConsultantDiaryCommentController::class
|
||||
)
|
||||
->parameters(['consultant_diary_comment' => 'diary']);
|
||||
}
|
||||
);
|
||||
|
||||
Route::get('/plan/{plan}', [PlanController::class,'show'])->name('plan.show');
|
||||
Route::get('/recipe/{recipe}', [RecipeController::class,'show'])->name('recipe.show');
|
||||
Route::get(
|
||||
'/plan/{plan}',
|
||||
[PlanController::class,'show']
|
||||
)->name('plan.show');
|
||||
|
||||
Route::get(
|
||||
'/recipe/{recipe}',
|
||||
[RecipeController::class,'show']
|
||||
)->name('recipe.show');
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user