bfd35905c9
- Added favicon and icon assets for the mobile app. - Implemented EmotionPicker component for selecting emotions with child options. - Created hooks for fetching emotions, feeds, and rapport data. - Established API service for handling requests and authentication. - Integrated Zustand for state management of user authentication. - Defined color palette for the application. - Set up TypeScript types for various entities including User, Emotion, and Feed. - Configured Babel and TypeScript for the mobile project. - Added package.json with necessary dependencies for Expo and React Native.
39 lines
901 B
PHP
39 lines
901 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class StoreFeedRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
$rules = [
|
|
'titre' => 'required|string|max:255',
|
|
'contenu' => 'required|string',
|
|
'image_url' => 'nullable|url|max:500',
|
|
'est_publie' => 'boolean',
|
|
'ordre' => 'integer|min:0',
|
|
];
|
|
|
|
if ($this->isMethod('POST')) {
|
|
$rules['slug'] = 'nullable|string|max:255|unique:feeds,slug';
|
|
} else {
|
|
$rules['slug'] = [
|
|
'nullable',
|
|
'string',
|
|
'max:255',
|
|
Rule::unique('feeds', 'slug')->ignore($this->route('id')),
|
|
];
|
|
}
|
|
|
|
return $rules;
|
|
}
|
|
}
|