├── README.md
├── backend
├── public
│ ├── favicon.ico
│ ├── robots.txt
│ ├── .htaccess
│ └── index.php
├── resources
│ ├── css
│ │ └── app.css
│ ├── views
│ │ ├── welcome.blade.php
│ │ └── view-email.blade.php
│ └── js
│ │ ├── app.js
│ │ └── bootstrap.js
├── database
│ ├── .gitignore
│ ├── seeders
│ │ └── DatabaseSeeder.php
│ ├── migrations
│ │ ├── 2023_01_29_204922_add_rate_to_rates_table.php
│ │ ├── 2023_01_24_160153_add_timestemps_to_favorites_table.php
│ │ ├── 2023_01_25_125039_add_message_to_notifications_table.php
│ │ ├── 2023_01_26_124417_add_etat_to_notifications_table.php
│ │ ├── 2014_10_12_100000_create_password_resets_table.php
│ │ ├── 2023_01_25_123847_add_statu_to_commandes_table.php
│ │ ├── 2023_02_10_141246_add_paswordtoken_to_users_table.php
│ │ ├── 2023_01_16_223048_create_categories_table.php
│ │ ├── 2023_01_29_185806_create_rates_table.php
│ │ ├── 2023_01_16_223253_create_options_table.php
│ │ ├── 2023_01_24_145906_create_favorites_table.php
│ │ ├── 2023_01_25_121956_create_ligne_commande_options_table.php
│ │ ├── 2019_08_19_000000_create_failed_jobs_table.php
│ │ ├── 2023_01_17_193406_create_option_specifiques_table.php
│ │ ├── 2023_01_25_100959_create_notifications_table.php
│ │ ├── 2023_01_16_223238_create_products_table.php
│ │ ├── 0000_00_00_000000_create_websockets_statistics_entries_table.php
│ │ ├── 2019_12_14_000001_create_personal_access_tokens_table.php
│ │ ├── 2014_10_12_000000_create_users_table.php
│ │ ├── 2023_01_25_112621_create_lign_commandes_table.php
│ │ └── 2023_01_24_151014_create_commandes_table.php
│ └── factories
│ │ └── UserFactory.php
├── storage
│ ├── logs
│ │ └── .gitignore
│ ├── app
│ │ ├── public
│ │ │ └── .gitignore
│ │ └── .gitignore
│ └── framework
│ │ ├── sessions
│ │ └── .gitignore
│ │ ├── testing
│ │ └── .gitignore
│ │ ├── views
│ │ └── .gitignore
│ │ ├── cache
│ │ ├── data
│ │ │ └── .gitignore
│ │ └── .gitignore
│ │ └── .gitignore
├── bootstrap
│ ├── cache
│ │ └── .gitignore
│ └── app.php
├── tests
│ ├── TestCase.php
│ ├── Unit
│ │ └── ExampleTest.php
│ ├── Feature
│ │ └── ExampleTest.php
│ └── CreatesApplication.php
├── .gitattributes
├── .gitignore
├── vite.config.js
├── .editorconfig
├── package.json
├── app
│ ├── Models
│ │ ├── Notification.php
│ │ ├── Option.php
│ │ ├── OptionSpecifique.php
│ │ ├── ligneCommandeOption.php
│ │ ├── Rate.php
│ │ ├── favorite.php
│ │ ├── Category.php
│ │ ├── Commande.php
│ │ ├── LignCommande.php
│ │ ├── Product.php
│ │ └── User.php
│ ├── Http
│ │ ├── Middleware
│ │ │ ├── EncryptCookies.php
│ │ │ ├── VerifyCsrfToken.php
│ │ │ ├── PreventRequestsDuringMaintenance.php
│ │ │ ├── TrustHosts.php
│ │ │ ├── TrimStrings.php
│ │ │ ├── Authenticate.php
│ │ │ ├── ValidateSignature.php
│ │ │ ├── TrustProxies.php
│ │ │ └── RedirectIfAuthenticated.php
│ │ ├── Controllers
│ │ │ ├── Controller.php
│ │ │ ├── test.php
│ │ │ ├── Auth
│ │ │ │ ├── ResetPassword
│ │ │ │ │ ├── ForgotPassword.php
│ │ │ │ │ └── ChangerPassword.php
│ │ │ │ ├── RegisterUser.php
│ │ │ │ ├── LoginUser.php
│ │ │ │ └── Verifyemail
│ │ │ │ │ └── VerificationEmail.php
│ │ │ ├── notification
│ │ │ │ └── ControllerNotification.php
│ │ │ ├── category
│ │ │ │ └── CategoryController.php
│ │ │ └── Option
│ │ │ │ └── OptionController.php
│ │ ├── Requests
│ │ │ ├── StoreResPassword.php
│ │ │ ├── StoreOption.php
│ │ │ ├── StoreCaregory.php
│ │ │ ├── StoreOptionSupp.php
│ │ │ ├── StoreChangerPassword.php
│ │ │ ├── StoreProductRequest.php
│ │ │ └── StoreUserRequest.php
│ │ └── Kernel.php
│ ├── Providers
│ │ ├── AppServiceProvider.php
│ │ ├── BroadcastServiceProvider.php
│ │ ├── AuthServiceProvider.php
│ │ ├── EventServiceProvider.php
│ │ └── RouteServiceProvider.php
│ ├── Console
│ │ └── Kernel.php
│ ├── Events
│ │ ├── PrivateTest.php
│ │ └── notif.php
│ ├── Exceptions
│ │ └── Handler.php
│ ├── Mail
│ │ └── ResetPassword.php
│ └── Notifications
│ │ ├── changer_email.php
│ │ └── notifications.php
├── lang
│ └── en
│ │ ├── pagination.php
│ │ ├── auth.php
│ │ └── passwords.php
├── routes
│ ├── console.php
│ ├── channels.php
│ └── web.php
├── config
│ ├── cors.php
│ ├── services.php
│ ├── view.php
│ ├── hashing.php
│ ├── broadcasting.php
│ ├── sanctum.php
│ ├── filesystems.php
│ ├── queue.php
│ ├── cache.php
│ ├── mail.php
│ ├── auth.php
│ ├── logging.php
│ ├── websockets.php
│ └── database.php
├── phpunit.xml
├── .env.example
├── .env
├── artisan
├── composer.json
└── README.md
└── frontend
├── .browserslistrc
├── public
├── favicon.ico
└── index.html
├── src
├── assets
│ ├── logo.png
│ ├── loader.gif
│ ├── home-img.png
│ ├── healthy_food.png
│ ├── apple-app-store-travel-awards-globestamp-7.png
│ └── logo.svg
├── plugins
│ ├── Vuelidate.js
│ ├── vuetify.js
│ └── axios.js
├── services
│ ├── AddProductsInPinia
│ │ └── AddProductsInPinia.js
│ ├── ResetPassword
│ │ └── reset_password.js
│ ├── Notification
│ │ └── notif.js
│ ├── auth.js
│ ├── GererCategory
│ │ └── category.js
│ ├── GererCommande
│ │ └── Commande.js
│ ├── GererOption
│ │ └── option.js
│ ├── GererProduct
│ │ └── GererProduct.js
│ └── GererUser
│ │ └── GererUser.js
├── global
│ └── interceptors.js
├── store
│ ├── StoreProducts.js
│ └── StoreAuth.js
├── views
│ ├── ProfilClient
│ │ └── EditProfilView.vue
│ └── ProfilAdmin
│ │ ├── Client
│ │ └── ConsulteClientView.vue
│ │ └── dashboard
│ │ └── SatistiqueView.vue
├── components
│ ├── preloader.vue
│ ├── home_page
│ │ ├── ServiceVue.vue
│ │ └── FooterVue.vue
│ └── ProfilAdmin
│ │ ├── option
│ │ ├── AddOption.vue
│ │ └── AddOptionProduct.vue
│ │ └── category
│ │ └── UpdateCategory.vue
├── App.vue
├── main.js
└── router
│ └── index.js
├── babel.config.js
├── .env
├── vue.config.js
├── .gitignore
├── jsconfig.json
├── README.md
├── .eslintrc.js
└── package.json
/README.md:
--------------------------------------------------------------------------------
1 | # FoodBundle
2 |
--------------------------------------------------------------------------------
/backend/public/favicon.ico:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/backend/resources/css/app.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/backend/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite*
2 |
--------------------------------------------------------------------------------
/backend/resources/views/welcome.blade.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/backend/resources/js/app.js:
--------------------------------------------------------------------------------
1 | import './bootstrap';
2 |
--------------------------------------------------------------------------------
/backend/storage/logs/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/backend/bootstrap/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/backend/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
3 |
--------------------------------------------------------------------------------
/backend/storage/app/public/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/backend/storage/app/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !public/
3 | !.gitignore
4 |
--------------------------------------------------------------------------------
/backend/storage/framework/sessions/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/backend/storage/framework/testing/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/backend/storage/framework/views/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/frontend/.browserslistrc:
--------------------------------------------------------------------------------
1 | > 1%
2 | last 2 versions
3 | not dead
4 |
--------------------------------------------------------------------------------
/backend/storage/framework/cache/data/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/backend/storage/framework/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !data/
3 | !.gitignore
4 |
--------------------------------------------------------------------------------
/frontend/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TalelMejri/FoodBundle/HEAD/frontend/public/favicon.ico
--------------------------------------------------------------------------------
/frontend/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TalelMejri/FoodBundle/HEAD/frontend/src/assets/logo.png
--------------------------------------------------------------------------------
/frontend/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/cli-plugin-babel/preset'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/frontend/src/assets/loader.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TalelMejri/FoodBundle/HEAD/frontend/src/assets/loader.gif
--------------------------------------------------------------------------------
/frontend/.env:
--------------------------------------------------------------------------------
1 | VUE_APP_WEBSOCKETS_KEY=local
2 | VUE_APP_WEBSOCKETS_SERVER=127.0.0.1
3 |
4 | baseURL=http://127.0.0.1:8000
--------------------------------------------------------------------------------
/frontend/src/assets/home-img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TalelMejri/FoodBundle/HEAD/frontend/src/assets/home-img.png
--------------------------------------------------------------------------------
/frontend/src/assets/healthy_food.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TalelMejri/FoodBundle/HEAD/frontend/src/assets/healthy_food.png
--------------------------------------------------------------------------------
/frontend/src/plugins/Vuelidate.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import Vuelidate from "vuelidate";
3 | Vue.use(Vuelidate);
4 | export default Vuelidate;
--------------------------------------------------------------------------------
/frontend/src/assets/apple-app-store-travel-awards-globestamp-7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TalelMejri/FoodBundle/HEAD/frontend/src/assets/apple-app-store-travel-awards-globestamp-7.png
--------------------------------------------------------------------------------
/backend/storage/framework/.gitignore:
--------------------------------------------------------------------------------
1 | compiled.php
2 | config.php
3 | down
4 | events.scanned.php
5 | maintenance.php
6 | routes.php
7 | routes.scanned.php
8 | schedule-*
9 | services.json
10 |
--------------------------------------------------------------------------------
/frontend/vue.config.js:
--------------------------------------------------------------------------------
1 | const { defineConfig } = require('@vue/cli-service')
2 | module.exports = defineConfig({
3 | transpileDependencies: [
4 | 'vuetify'
5 | ],
6 | lintOnSave:false
7 | })
8 |
--------------------------------------------------------------------------------
/backend/tests/TestCase.php:
--------------------------------------------------------------------------------
1 | assertTrue(true);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/frontend/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "module": "esnext",
5 | "baseUrl": "./",
6 | "moduleResolution": "node",
7 | "paths": {
8 | "@/*": [
9 | "src/*"
10 | ]
11 | },
12 | "lib": [
13 | "esnext",
14 | "dom",
15 | "dom.iterable",
16 | "scripthost"
17 | ]
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/frontend/src/services/ResetPassword/reset_password.js:
--------------------------------------------------------------------------------
1 | import axios from "axios";
2 | import '@/plugins/axios';
3 |
4 | export default{
5 |
6 | ForgotPassword(email){
7 | return axios.post('resetPassword/forgot_password',email);
8 | },
9 |
10 | ChangerPassword(data){
11 | return axios.post('resetPassword/changer_password',data);
12 | }
13 |
14 | }
--------------------------------------------------------------------------------
/backend/app/Models/Notification.php:
--------------------------------------------------------------------------------
1 | belongsTo(User::class);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/backend/app/Models/Option.php:
--------------------------------------------------------------------------------
1 | belongsTo(Category::class);
15 | }
16 |
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/backend/app/Models/OptionSpecifique.php:
--------------------------------------------------------------------------------
1 | belongsTo(Product::class);
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/backend/app/Http/Middleware/EncryptCookies.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | //
16 | ];
17 | }
18 |
--------------------------------------------------------------------------------
/backend/app/Models/ligneCommandeOption.php:
--------------------------------------------------------------------------------
1 | belongsTo(ligncommande::class);
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/backend/app/Http/Middleware/VerifyCsrfToken.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | //
16 | ];
17 | }
18 |
--------------------------------------------------------------------------------
/frontend/README.md:
--------------------------------------------------------------------------------
1 | # frontend
2 |
3 | ## Project setup
4 | ```
5 | npm install
6 | ```
7 |
8 | ### Compiles and hot-reloads for development
9 | ```
10 | npm run serve
11 | ```
12 |
13 | ### Compiles and minifies for production
14 | ```
15 | npm run build
16 | ```
17 |
18 | ### Lints and fixes files
19 | ```
20 | npm run lint
21 | ```
22 |
23 | ### Customize configuration
24 | See [Configuration Reference](https://cli.vuejs.org/config/).
25 |
--------------------------------------------------------------------------------
/frontend/src/global/interceptors.js:
--------------------------------------------------------------------------------
1 | import Axios from "axios";
2 | import { AuthStore } from "../store/StoreAuth.js";
3 | export function interceptors() {
4 | Axios.interceptors.request.use(
5 | function (config) {
6 | const store = AuthStore();
7 | config.headers.Authorization = `Bearer ${store.token}`;
8 | return config;
9 | },
10 | function (error) {
11 | return Promise.reject(error);
12 | }
13 | );
14 | }
--------------------------------------------------------------------------------
/backend/app/Http/Controllers/Controller.php:
--------------------------------------------------------------------------------
1 | belongsTo(User::class);
14 | }
15 |
16 | public function product(){
17 | return $this->belongsTo(Product::class);
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/backend/app/Models/favorite.php:
--------------------------------------------------------------------------------
1 | belongsTo(Product::class);
14 | }
15 |
16 | public function user(){
17 | return $this->belongsTo(User::class);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/backend/app/Http/Middleware/PreventRequestsDuringMaintenance.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | //
16 | ];
17 | }
18 |
--------------------------------------------------------------------------------
/backend/app/Http/Middleware/TrustHosts.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | public function hosts()
15 | {
16 | return [
17 | $this->allSubdomainsOfApplicationUrl(),
18 | ];
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/backend/app/Models/Category.php:
--------------------------------------------------------------------------------
1 | hasMany(Product::class);
16 | }
17 |
18 | public function options(){
19 | return $this->hasMany(Option::class);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/backend/app/Http/Middleware/TrimStrings.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | 'current_password',
16 | 'password',
17 | 'password_confirmation',
18 | ];
19 | }
20 |
--------------------------------------------------------------------------------
/backend/tests/Feature/ExampleTest.php:
--------------------------------------------------------------------------------
1 | get('/');
18 |
19 | $response->assertStatus(200);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/backend/app/Models/Commande.php:
--------------------------------------------------------------------------------
1 | belongsTo(User::class);
15 | }
16 |
17 | public function ligencommandes(){
18 | return $this->hasMany(LignCommande::class);
19 | }
20 |
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/backend/tests/CreatesApplication.php:
--------------------------------------------------------------------------------
1 | make(Kernel::class)->bootstrap();
19 |
20 | return $app;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/frontend/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: {
4 | node: true
5 | },
6 | 'extends': [
7 | 'plugin:vue/essential',
8 | 'eslint:recommended'
9 | ],
10 | parserOptions: {
11 | parser: '@babel/eslint-parser'
12 | },
13 | files: ['src/views/**/*.vue'],
14 | rules: {
15 | 'vue/multi-word-component-names': 0,
16 | 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
17 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/frontend/src/assets/logo.svg:
--------------------------------------------------------------------------------
1 | Artboard 46
2 |
--------------------------------------------------------------------------------
/backend/app/Providers/AppServiceProvider.php:
--------------------------------------------------------------------------------
1 | expectsJson()) {
18 | return route('login');
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/backend/app/Http/Middleware/ValidateSignature.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | // 'fbclid',
16 | // 'utm_campaign',
17 | // 'utm_content',
18 | // 'utm_medium',
19 | // 'utm_source',
20 | // 'utm_term',
21 | ];
22 | }
23 |
--------------------------------------------------------------------------------
/frontend/src/services/Notification/notif.js:
--------------------------------------------------------------------------------
1 | import "@/plugins/axios";
2 | import Axios from "axios";
3 |
4 | export default{
5 | getNotification(){
6 | return Axios.get('notif/getnotif');
7 | },
8 | getAllNotification(){
9 | return Axios.get('notif/getAllNotification');
10 | },
11 | deleteAllNotif(){
12 | return Axios.delete('notif/deleteAllNotif');
13 | },
14 | deleteNotification(id){
15 | return Axios.delete('notif/deleteNotification/'+id);
16 | },
17 | changeretat(id){
18 | return Axios.put('notif/changeretat/'+id);
19 | }
20 | }
--------------------------------------------------------------------------------
/backend/database/seeders/DatabaseSeeder.php:
--------------------------------------------------------------------------------
1 | create();
18 |
19 | // \App\Models\User::factory()->create([
20 | // 'name' => 'Test User',
21 | // 'email' => 'test@example.com',
22 | // ]);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/backend/lang/en/pagination.php:
--------------------------------------------------------------------------------
1 | '« Previous',
17 | 'next' => 'Next »',
18 |
19 | ];
20 |
--------------------------------------------------------------------------------
/backend/app/Models/LignCommande.php:
--------------------------------------------------------------------------------
1 | belongsTo(Commande::class);
15 | }
16 |
17 | public function product(){
18 | return $this->belongsTo(Product::class);
19 | }
20 |
21 | public function ligensOptions(){
22 | return $this->hasmany(ligneCommandeOption::class);
23 | }
24 |
25 |
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/frontend/src/store/StoreProducts.js:
--------------------------------------------------------------------------------
1 | import { ref,computed } from "vue"
2 | import { defineStore } from "pinia";
3 |
4 | export const ProductStore=defineStore('ProductStore',()=>{
5 |
6 | const Products=ref(JSON.parse(localStorage.getItem('Products'))??null);
7 |
8 | const getProducts=computed(()=>Products.value);
9 |
10 | function AddProduct(p){
11 | localStorage.setItem('Products',JSON.stringify(p));
12 | }
13 |
14 | function ClearProducts(){
15 | localStorage.removeItem('Products');
16 | }
17 |
18 | return {Products,getProducts,AddProduct,ClearProducts}
19 |
20 | })
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/backend/app/Providers/BroadcastServiceProvider.php:
--------------------------------------------------------------------------------
1 | "api", "middleware" => ["auth:sanctum"]]);
19 | //Broadcast::routes(['middleware' => ['auth:api']]);
20 | require base_path('routes/channels.php');
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/backend/app/Http/Controllers/test.php:
--------------------------------------------------------------------------------
1 | email)->send(new ResetPassword($data['code']));
19 | return response()->json(['message'=>"Code Envoyer A votre email avec success"],200);
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/backend/routes/console.php:
--------------------------------------------------------------------------------
1 | comment(Inspiring::quote());
19 | })->purpose('Display an inspiring quote');
20 |
--------------------------------------------------------------------------------
/backend/public/.htaccess:
--------------------------------------------------------------------------------
1 |
2 |
3 | Options -MultiViews -Indexes
4 |
5 |
6 | RewriteEngine On
7 |
8 | # Handle Authorization Header
9 | RewriteCond %{HTTP:Authorization} .
10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
11 |
12 | # Redirect Trailing Slashes If Not A Folder...
13 | RewriteCond %{REQUEST_FILENAME} !-d
14 | RewriteCond %{REQUEST_URI} (.+)/$
15 | RewriteRule ^ %1 [L,R=301]
16 |
17 | # Send Requests To Front Controller...
18 | RewriteCond %{REQUEST_FILENAME} !-d
19 | RewriteCond %{REQUEST_FILENAME} !-f
20 | RewriteRule ^ index.php [L]
21 |
22 |
--------------------------------------------------------------------------------
/backend/app/Http/Requests/StoreResPassword.php:
--------------------------------------------------------------------------------
1 |
23 | */
24 | public function rules()
25 | {
26 | return [
27 | 'email'=>"required|email|exists:users"
28 | ];
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/backend/app/Http/Requests/StoreOption.php:
--------------------------------------------------------------------------------
1 |
23 | */
24 | public function rules()
25 | {
26 | return [
27 | 'nameOption'=>"required",
28 |
29 | //'category_id'=>"required"
30 | ];
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/backend/app/Http/Requests/StoreCaregory.php:
--------------------------------------------------------------------------------
1 |
23 | */
24 | public function rules()
25 | {
26 | return [
27 | "name"=>"required|unique:categories",
28 | "option"=>"required",
29 | ];
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/backend/app/Http/Requests/StoreOptionSupp.php:
--------------------------------------------------------------------------------
1 |
23 | */
24 | public function rules()
25 | {
26 | return [
27 | /*'nameOptionSpecifique'=>"required",
28 | 'prixOptionSpecifique'=>"required"*/
29 | ];
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/backend/lang/en/auth.php:
--------------------------------------------------------------------------------
1 | 'These credentials do not match our records.',
17 | 'password' => 'The provided password is incorrect.',
18 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
19 |
20 | ];
21 |
--------------------------------------------------------------------------------
/backend/routes/channels.php:
--------------------------------------------------------------------------------
1 | id === (int) $id;
18 | });
19 |
20 |
21 | Broadcast::channel('channel-name-{id}', function ($user, $id) {
22 | return (int) $user->id === (int) $id;
23 | });
24 |
--------------------------------------------------------------------------------
/backend/app/Providers/AuthServiceProvider.php:
--------------------------------------------------------------------------------
1 |
14 | */
15 | protected $policies = [
16 | // 'App\Models\Model' => 'App\Policies\ModelPolicy',
17 | ];
18 |
19 | /**
20 | * Register any authentication / authorization services.
21 | *
22 | * @return void
23 | */
24 | public function boot()
25 | {
26 | $this->registerPolicies();
27 |
28 | //
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/backend/database/migrations/2023_01_29_204922_add_rate_to_rates_table.php:
--------------------------------------------------------------------------------
1 | integer('rate');
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | *
24 | * @return void
25 | */
26 | public function down()
27 | {
28 | Schema::table('rates', function (Blueprint $table) {
29 | //
30 | });
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/backend/app/Http/Middleware/TrustProxies.php:
--------------------------------------------------------------------------------
1 | |string|null
14 | */
15 | protected $proxies;
16 |
17 | /**
18 | * The headers that should be used to detect proxies.
19 | *
20 | * @var int
21 | */
22 | protected $headers =
23 | Request::HEADER_X_FORWARDED_FOR |
24 | Request::HEADER_X_FORWARDED_HOST |
25 | Request::HEADER_X_FORWARDED_PORT |
26 | Request::HEADER_X_FORWARDED_PROTO |
27 | Request::HEADER_X_FORWARDED_AWS_ELB;
28 | }
29 |
--------------------------------------------------------------------------------
/backend/database/migrations/2023_01_24_160153_add_timestemps_to_favorites_table.php:
--------------------------------------------------------------------------------
1 | timestamps();
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | *
24 | * @return void
25 | */
26 | public function down()
27 | {
28 | Schema::table('favorites', function (Blueprint $table) {
29 | //
30 | });
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/backend/app/Http/Requests/StoreChangerPassword.php:
--------------------------------------------------------------------------------
1 |
23 | */
24 | public function rules()
25 | {
26 | return [
27 | 'password_token'=>"required|exists:users",
28 | 'email'=>"required|email|exists:users",
29 | 'password'=>"required"
30 | ];
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/backend/app/Models/Product.php:
--------------------------------------------------------------------------------
1 | hasMany(OptionSpecifique::class);
15 | }
16 |
17 | public function Favorites(){
18 | return $this->hasMany(favorite::class);
19 | }
20 |
21 | public function rates(){
22 | return $this->hasMany(Rate::class);
23 | }
24 |
25 | public function lignecommandes(){
26 | return $this->hasMany(lignecommande::class);
27 | }
28 |
29 | public function categorie(){
30 | return $this->belongsTo(Category::class);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/backend/database/migrations/2023_01_25_125039_add_message_to_notifications_table.php:
--------------------------------------------------------------------------------
1 | string('message');
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | *
24 | * @return void
25 | */
26 | public function down()
27 | {
28 | Schema::table('notifications', function (Blueprint $table) {
29 | //
30 | });
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/backend/database/migrations/2023_01_26_124417_add_etat_to_notifications_table.php:
--------------------------------------------------------------------------------
1 | boolean('etat')->default(false);
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | *
24 | * @return void
25 | */
26 | public function down()
27 | {
28 | Schema::table('notifications', function (Blueprint $table) {
29 | //
30 | });
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/backend/app/Console/Kernel.php:
--------------------------------------------------------------------------------
1 | command('inspire')->hourly();
19 | }
20 |
21 | /**
22 | * Register the commands for the application.
23 | *
24 | * @return void
25 | */
26 | protected function commands()
27 | {
28 | $this->load(__DIR__.'/Commands');
29 |
30 | require base_path('routes/console.php');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/frontend/src/views/ProfilClient/EditProfilView.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Food Bundle
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/backend/lang/en/passwords.php:
--------------------------------------------------------------------------------
1 | 'Your password has been reset!',
17 | 'sent' => 'We have emailed your password reset link!',
18 | 'throttled' => 'Please wait before retrying.',
19 | 'token' => 'This password reset token is invalid.',
20 | 'user' => "We can't find a user with that email address.",
21 |
22 | ];
23 |
--------------------------------------------------------------------------------
/frontend/src/components/preloader.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
19 |
20 |
--------------------------------------------------------------------------------
/backend/database/migrations/2014_10_12_100000_create_password_resets_table.php:
--------------------------------------------------------------------------------
1 | string('email')->primary();
18 | $table->string('token');
19 | $table->timestamp('created_at')->nullable();
20 | });
21 | }
22 |
23 | /**
24 | * Reverse the migrations.
25 | *
26 | * @return void
27 | */
28 | public function down()
29 | {
30 | Schema::dropIfExists('password_resets');
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/backend/app/Http/Requests/StoreProductRequest.php:
--------------------------------------------------------------------------------
1 |
23 | */
24 | public function rules()
25 | {
26 | return [
27 | "nameProduct"=>"required|unique:products|max:20",
28 | "PrixProduct"=>"required",
29 | "PhotoProduct"=>"required|max:255|mimes:jpg,png,svg,gif",
30 | "id_category"=>"required"
31 | ];
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/backend/database/migrations/2023_01_25_123847_add_statu_to_commandes_table.php:
--------------------------------------------------------------------------------
1 | boolean('statu')->default(false);
18 | $table->double('Code_Commande')->unique();
19 | });
20 | }
21 |
22 | /**
23 | * Reverse the migrations.
24 | *
25 | * @return void
26 | */
27 | public function down()
28 | {
29 | Schema::table('commandes', function (Blueprint $table) {
30 | //
31 | });
32 | }
33 | };
34 |
--------------------------------------------------------------------------------
/backend/database/migrations/2023_02_10_141246_add_paswordtoken_to_users_table.php:
--------------------------------------------------------------------------------
1 | integer('password_token')->nullable();
18 | $table->timestamp('password_token_send_at')->nullable();
19 | });
20 | }
21 |
22 | /**
23 | * Reverse the migrations.
24 | *
25 | * @return void
26 | */
27 | public function down()
28 | {
29 | Schema::table('users', function (Blueprint $table) {
30 | //
31 | });
32 | }
33 | };
34 |
--------------------------------------------------------------------------------
/frontend/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | FoodBundle
9 |
10 |
11 |
12 |
13 |
14 | We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/backend/database/migrations/2023_01_16_223048_create_categories_table.php:
--------------------------------------------------------------------------------
1 | id();
19 | $table->string('name')->unique();
20 | $table->longText('PhtotoCatg');
21 | $table->timestamps();
22 | });
23 | }
24 |
25 | /**
26 | * Reverse the migrations.
27 | *
28 | * @return void
29 | */
30 | public function down()
31 | {
32 | Schema::dropIfExists('categories');
33 | }
34 | };
35 |
--------------------------------------------------------------------------------
/frontend/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
25 |
26 |
27 |
44 |
--------------------------------------------------------------------------------
/backend/routes/web.php:
--------------------------------------------------------------------------------
1 | name;
31 | });
32 |
--------------------------------------------------------------------------------
/backend/app/Http/Requests/StoreUserRequest.php:
--------------------------------------------------------------------------------
1 |
23 | */
24 | public function rules()
25 | {
26 | return [
27 | 'name'=>'required|min:4|max:9',
28 | 'email'=>'required|unique:users|email',
29 | 'password'=>'required|min:6|max:12',
30 | 'lastname'=>'required|min:4|max:9',
31 | 'numero_tlf'=>'required|digits:8|numeric',
32 | 'Photo'=>'required|mimes:jpg,jpeg,png,svg,gif'
33 | ];
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/backend/resources/views/view-email.blade.php:
--------------------------------------------------------------------------------
1 | @component('mail::message')
2 | Nous avons bien reçu votre demande de réinitialisation du mot de passe de votre compte
3 | Vous pouvez utiliser la commande de code suivante pour récupérer votre compte :
4 | @component('mail::panel')
5 | {{ $code }}
6 | @endcomponent
7 |
8 |
16 |
18 | Reset Mot de passe
19 |
20 |
21 |
22 | La durée autorisée pour le code est de 1h à partir de l'envoi du message
23 | @endcomponent
24 |
--------------------------------------------------------------------------------
/backend/database/migrations/2023_01_29_185806_create_rates_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->foreignId('user_id')->constrained()->cascadeOnDelete();
19 | $table->foreignId('product_id');
20 | $table->foreign('product_id')->references('id')->on('products')->cascadeOnDelete();
21 | $table->timestamps();
22 | });
23 | }
24 |
25 | /**
26 | * Reverse the migrations.
27 | *
28 | * @return void
29 | */
30 | public function down()
31 | {
32 | Schema::dropIfExists('rates');
33 | }
34 | };
35 |
--------------------------------------------------------------------------------
/backend/app/Http/Controllers/Auth/ResetPassword/ForgotPassword.php:
--------------------------------------------------------------------------------
1 | email)->firstOrFail();
18 | $user_forgot_password->password_token=$token;
19 | $user_forgot_password->password_token_send_at=now();
20 | $user_forgot_password->save();
21 | Mail::to($request->email)->send(new ResetPassword($token));
22 | return response()->json(['message'=>"Code Envoyer A votre email avec success"],200);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/backend/database/migrations/2023_01_16_223253_create_options_table.php:
--------------------------------------------------------------------------------
1 | id();
19 | $table->string("nameOption");
20 | $table->foreignId('category_id');
21 | $table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade');
22 | $table->timestamps();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | *
29 | * @return void
30 | */
31 | public function down()
32 | {
33 | Schema::dropIfExists('options');
34 | }
35 | };
36 |
--------------------------------------------------------------------------------
/backend/config/cors.php:
--------------------------------------------------------------------------------
1 | ['api/*', 'sanctum/csrf-cookie'],
19 |
20 | 'allowed_methods' => ['*'],
21 |
22 | 'allowed_origins' => ['*'],
23 |
24 | 'allowed_origins_patterns' => [],
25 |
26 | 'allowed_headers' => ['*'],
27 |
28 | 'exposed_headers' => [],
29 |
30 | 'max_age' => 0,
31 |
32 | 'supports_credentials' => false,
33 |
34 | ];
35 |
--------------------------------------------------------------------------------
/backend/database/migrations/2023_01_24_145906_create_favorites_table.php:
--------------------------------------------------------------------------------
1 | foreignId('product_id');
19 | $table->foreignId('user_id');
20 | $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
21 | $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
22 |
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | *
29 | * @return void
30 | */
31 | public function down()
32 | {
33 | Schema::dropIfExists('favorites');
34 | }
35 | };
36 |
--------------------------------------------------------------------------------
/backend/database/migrations/2023_01_25_121956_create_ligne_commande_options_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string("nameOption");
19 | $table->foreignId('lign_commande_id');
20 | $table->foreign('lign_commande_id')->references('id')->on('lign_commandes')->cascadeOnDelete();
21 | $table->timestamps();
22 | });
23 | }
24 |
25 | /**
26 | * Reverse the migrations.
27 | *
28 | * @return void
29 | */
30 | public function down()
31 | {
32 | Schema::dropIfExists('lign_commande_options');
33 | }
34 | };
35 |
--------------------------------------------------------------------------------
/backend/database/migrations/2019_08_19_000000_create_failed_jobs_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string('uuid')->unique();
19 | $table->text('connection');
20 | $table->text('queue');
21 | $table->longText('payload');
22 | $table->longText('exception');
23 | $table->timestamp('failed_at')->useCurrent();
24 | });
25 | }
26 |
27 | /**
28 | * Reverse the migrations.
29 | *
30 | * @return void
31 | */
32 | public function down()
33 | {
34 | Schema::dropIfExists('failed_jobs');
35 | }
36 | };
37 |
--------------------------------------------------------------------------------
/frontend/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import "./plugins/axios";
3 | import App from "./App.vue";
4 | import router from "./router";
5 | import store from "./store/StoreAuth";
6 | import "aos/dist/aos.css";
7 | import Vuelidate from "./plugins/Vuelidate";
8 | import { createPinia, PiniaVuePlugin } from "pinia";
9 | import { interceptors } from "../src/global/interceptors.js";
10 | import vuetify from "./plugins/vuetify";
11 | Vue.use(PiniaVuePlugin);
12 | export const pinia = createPinia();
13 | Vue.config.productionTip = false;
14 | interceptors();
15 |
16 | import Echo from "laravel-echo";
17 | window.Pusher = require("pusher-js");
18 | window.Echo = new Echo({
19 | broadcaster: "pusher",
20 | key: process.env.VUE_APP_WEBSOCKETS_KEY,
21 | wsHost: process.env.VUE_APP_WEBSOCKETS_SERVER,
22 | wsPort: 6001,
23 | cluster: "mt1",
24 | forceTLS: false,
25 | disableStats: true,
26 | });
27 |
28 | new Vue({
29 | Vuelidate,
30 | pinia,
31 | router,
32 | store,
33 | vuetify,
34 | render: (h) => h(App),
35 | }).$mount("#app");
36 |
--------------------------------------------------------------------------------
/backend/app/Http/Middleware/RedirectIfAuthenticated.php:
--------------------------------------------------------------------------------
1 | check()) {
26 | return redirect(RouteServiceProvider::HOME);
27 | }
28 | }
29 |
30 | return $next($request);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/backend/database/migrations/2023_01_17_193406_create_option_specifiques_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string("nameOptionSpecifique");
19 | $table->double("prixOptionSpecifique");
20 | $table->foreignId('product_id');
21 | $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
22 | $table->timestamps();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | *
29 | * @return void
30 | */
31 | public function down()
32 | {
33 | Schema::dropIfExists('option_specifiques');
34 | }
35 | };
36 |
--------------------------------------------------------------------------------
/backend/database/migrations/2023_01_25_100959_create_notifications_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->foreignId('user_id');
19 | $table->foreign('user_id')->references('id')->on('users')->cascadeOnDelete();
20 | $table->foreignId('commande_id');
21 | $table->foreign('commande_id')->references('id')->on('commandes')->cascadeOnDelete();
22 | $table->timestamps();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | *
29 | * @return void
30 | */
31 | public function down()
32 | {
33 | Schema::dropIfExists('notifications');
34 | }
35 | };
36 |
--------------------------------------------------------------------------------
/backend/database/migrations/2023_01_16_223238_create_products_table.php:
--------------------------------------------------------------------------------
1 | id();
19 | $table->string('nameProduct');
20 | $table->double('PrixProduct');
21 | $table->longText('PhotoProduct');
22 | $table->foreignId('id_category');
23 | $table->foreign('id_category')->references('id')->on('categories');
24 | $table->timestamps();
25 | });
26 | }
27 |
28 | /**
29 | * Reverse the migrations.
30 | *
31 | * @return void
32 | */
33 | public function down()
34 | {
35 | Schema::dropIfExists('products');
36 | }
37 | };
38 |
--------------------------------------------------------------------------------
/backend/database/migrations/0000_00_00_000000_create_websockets_statistics_entries_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('app_id');
19 | $table->integer('peak_connection_count');
20 | $table->integer('websocket_message_count');
21 | $table->integer('api_message_count');
22 | $table->nullableTimestamps();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | *
29 | * @return void
30 | */
31 | public function down()
32 | {
33 | Schema::dropIfExists('websockets_statistics_entries');
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/backend/app/Events/PrivateTest.php:
--------------------------------------------------------------------------------
1 | user=$user;
27 | }
28 |
29 | /**
30 | * Get the channels the event should broadcast on.
31 | *
32 | * @return \Illuminate\Broadcasting\Channel|array
33 | */
34 | public function broadcastOn()
35 | {
36 | return new PrivateChannel('channel-name'.$this->user->id);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/backend/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->morphs('tokenable');
19 | $table->string('name');
20 | $table->string('token', 64)->unique();
21 | $table->text('abilities')->nullable();
22 | $table->timestamp('last_used_at')->nullable();
23 | $table->timestamp('expires_at')->nullable();
24 | $table->timestamps();
25 | });
26 | }
27 |
28 | /**
29 | * Reverse the migrations.
30 | *
31 | * @return void
32 | */
33 | public function down()
34 | {
35 | Schema::dropIfExists('personal_access_tokens');
36 | }
37 | };
38 |
--------------------------------------------------------------------------------
/backend/config/services.php:
--------------------------------------------------------------------------------
1 | [
18 | 'domain' => env('MAILGUN_DOMAIN'),
19 | 'secret' => env('MAILGUN_SECRET'),
20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
21 | 'scheme' => 'https',
22 | ],
23 |
24 | 'postmark' => [
25 | 'token' => env('POSTMARK_TOKEN'),
26 | ],
27 |
28 | 'ses' => [
29 | 'key' => env('AWS_ACCESS_KEY_ID'),
30 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
31 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
32 | ],
33 |
34 | ];
35 |
--------------------------------------------------------------------------------
/backend/app/Providers/EventServiceProvider.php:
--------------------------------------------------------------------------------
1 | >
16 | */
17 | protected $listen = [
18 | Registered::class => [
19 | SendEmailVerificationNotification::class,
20 | ],
21 | ];
22 |
23 | /**
24 | * Register any events for your application.
25 | *
26 | * @return void
27 | */
28 | public function boot()
29 | {
30 | //
31 | }
32 |
33 | /**
34 | * Determine if events and listeners should be automatically discovered.
35 | *
36 | * @return bool
37 | */
38 | public function shouldDiscoverEvents()
39 | {
40 | return false;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/backend/database/factories/UserFactory.php:
--------------------------------------------------------------------------------
1 |
10 | */
11 | class UserFactory extends Factory
12 | {
13 | /**
14 | * Define the model's default state.
15 | *
16 | * @return array
17 | */
18 | public function definition()
19 | {
20 | return [
21 | 'name' => fake()->name(),
22 | 'email' => fake()->unique()->safeEmail(),
23 | 'email_verified_at' => now(),
24 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
25 | 'remember_token' => Str::random(10),
26 | ];
27 | }
28 |
29 | /**
30 | * Indicate that the model's email address should be unverified.
31 | *
32 | * @return static
33 | */
34 | public function unverified()
35 | {
36 | return $this->state(fn (array $attributes) => [
37 | 'email_verified_at' => null,
38 | ]);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/backend/database/migrations/2014_10_12_000000_create_users_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string('name');
19 | $table->string('lastname');
20 | $table->string('email')->unique();
21 | $table->string('password');
22 | $table->Boolean('Isadmin');
23 | $table->string('Photo');
24 | $table->string('numero_tlf');
25 | $table->timestamp('email_verified_at')->nullable();
26 | $table->rememberToken();
27 | $table->timestamps();
28 | });
29 | }
30 |
31 | /**
32 | * Reverse the migrations.
33 | *
34 | * @return void
35 | */
36 | public function down()
37 | {
38 | Schema::dropIfExists('users');
39 | }
40 | };
41 |
--------------------------------------------------------------------------------
/backend/database/migrations/2023_01_25_112621_create_lign_commandes_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->integer('Quantity');
19 | $table->double('prix_ligne_commande');
20 | $table->foreignId('commande_id');
21 | $table->foreignId('product_id');
22 | $table->foreign('product_id')->references('id')->on('products')->cascadeOnDelete();
23 | $table->foreign('commande_id')->references('id')->on('commandes')->cascadeOnDelete();
24 | $table->timestamps();
25 | });
26 | }
27 |
28 | /**
29 | * Reverse the migrations.
30 | *
31 | * @return void
32 | */
33 | public function down()
34 | {
35 | Schema::dropIfExists('lign_commandes');
36 | }
37 | };
38 |
--------------------------------------------------------------------------------
/frontend/src/services/auth.js:
--------------------------------------------------------------------------------
1 | import "@/plugins/axios";
2 | import Axios from "axios";
3 |
4 | import {AuthStore} from "@/store/StoreAuth";
5 |
6 | export default{
7 |
8 | CreateUser(user){
9 | let data =new FormData();
10 | data.append('Photo',user.photo);
11 | data.append('name',user.name);
12 | data.append('email',user.email);
13 | data.append('password',user.password);
14 | data.append('lastname',user.lastname);
15 | data.append('numero_tlf',user.numero_tlf);
16 | const config={
17 | Headers:{
18 | "content-Type":'multipart/form-data',
19 | },
20 | };
21 | return Axios.post('auth/registerUser',data,config);
22 | },
23 |
24 | async LoginUser(email,password){
25 | const store=AuthStore();
26 | const res= await Axios.post('auth/loginUser',{email,password});
27 | if(res.status===200){
28 | store.login(res.data.data.token,res.data.data.user,res.data.data.isAdmin);
29 | }else{
30 | store.logout();
31 | }
32 | },
33 |
34 | ExistEmail(email){
35 | return Axios.get('auth/exist/'+email);
36 | }
37 |
38 | }
--------------------------------------------------------------------------------
/backend/config/view.php:
--------------------------------------------------------------------------------
1 | [
17 | resource_path('views'),
18 | ],
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Compiled View Path
23 | |--------------------------------------------------------------------------
24 | |
25 | | This option determines where all the compiled Blade templates will be
26 | | stored for your application. Typically, this is within the storage
27 | | directory. However, as usual, you are free to change this value.
28 | |
29 | */
30 |
31 | 'compiled' => env(
32 | 'VIEW_COMPILED_PATH',
33 | realpath(storage_path('framework/views'))
34 | ),
35 |
36 | ];
37 |
--------------------------------------------------------------------------------
/backend/app/Http/Controllers/Auth/RegisterUser.php:
--------------------------------------------------------------------------------
1 | Photo->getClientOriginalName();
14 | $image = $request->file('Photo')->storeAs('users', $file_name, 'public');
15 | //$image=Storage::disk('public')->put('users',$request->file('Photo'));
16 |
17 | $user=User::create([
18 | 'name'=>$request->name,
19 | 'email'=>$request->email,
20 | 'password'=>bcrypt($request->password),
21 | 'lastname'=>$request->lastname,
22 | 'numero_tlf'=>$request->numero_tlf,
23 | 'Photo'=>'/storage/' . $image,
24 | 'Isadmin'=>false,
25 | ]
26 | );
27 | $user->sendEmailVerify();
28 | return response()->json(['data'=>$user], 200);
29 | }
30 | }
31 |
32 | // public function getuser(){
33 | // $user=User::all();
34 | // return $user;
35 | // }
36 |
37 |
--------------------------------------------------------------------------------
/backend/app/Events/notif.php:
--------------------------------------------------------------------------------
1 | notif=$notif;
28 | }
29 | public function broadcastWith()
30 | {
31 | return [
32 | 'message'=>$this->notif
33 | ];
34 | }
35 | /**
36 | * Get the channels the event should broadcast on.
37 | *
38 | * @return \Illuminate\Broadcasting\Channel|array
39 | */
40 | public function broadcastOn()
41 | {
42 | return new Channel('public');
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/backend/app/Exceptions/Handler.php:
--------------------------------------------------------------------------------
1 | , \Psr\Log\LogLevel::*>
14 | */
15 | protected $levels = [
16 | //
17 | ];
18 |
19 | /**
20 | * A list of the exception types that are not reported.
21 | *
22 | * @var array>
23 | */
24 | protected $dontReport = [
25 | //
26 | ];
27 |
28 | /**
29 | * A list of the inputs that are never flashed to the session on validation exceptions.
30 | *
31 | * @var array
32 | */
33 | protected $dontFlash = [
34 | 'current_password',
35 | 'password',
36 | 'password_confirmation',
37 | ];
38 |
39 | /**
40 | * Register the exception handling callbacks for the application.
41 | *
42 | * @return void
43 | */
44 | public function register()
45 | {
46 | $this->reportable(function (Throwable $e) {
47 | //
48 | });
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/backend/database/migrations/2023_01_24_151014_create_commandes_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string('Nom');
19 | $table->string('adresse_email');
20 | $table->string('Ville');
21 | $table->string('Pays');
22 | $table->string('Code_Postal');
23 | $table->string('Prenom');
24 | $table->string('Numero_tlf');
25 | $table->string('Adresse');
26 | $table->double('Prix_Total');
27 | $table->foreignId('user_id');
28 | $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
29 | $table->timestamps();
30 | });
31 | }
32 |
33 | /**
34 | * Reverse the migrations.
35 | *
36 | * @return void
37 | */
38 | public function down()
39 | {
40 | Schema::dropIfExists('commandes');
41 | }
42 | };
43 |
--------------------------------------------------------------------------------
/backend/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 | ./tests/Unit
10 |
11 |
12 | ./tests/Feature
13 |
14 |
15 |
16 |
17 | ./app
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/frontend/src/services/GererCategory/category.js:
--------------------------------------------------------------------------------
1 | import "@/plugins/axios";
2 | import axios from "axios";
3 |
4 |
5 | export default{
6 |
7 | addCategory(product){
8 | /*var data=new FormData();
9 | data.append('name',product.name);
10 | data.append('option',product.option);
11 | data.append('file',product.file);*/
12 |
13 | //console.log(product.option);
14 | return axios.post('category/addCategory',product);
15 | },
16 |
17 | getAllTypeCategory(){
18 | return axios.get('category/AllTypeCategorie');
19 | },
20 |
21 | getAllCategorieOptions(search,page){
22 | return axios.get(`category/GetOptionForCategorie?${search ? "search="+search : ""}&page=${page}`);
23 | },
24 |
25 | deleteCategory(id){
26 | return axios.delete('category/deleteCategory/'+id);
27 | },
28 |
29 | UpdateCategory(id,category){
30 | return axios.post('category/UpdateCategory/'+id,category);
31 | },
32 |
33 | findCategoryByIid(id){
34 | return axios.get('category/findCategoryByIid/'+id);
35 | },
36 |
37 | CountCategory(){
38 | return axios.get('category/CountCategory');
39 | },
40 |
41 | getAllCategorie(){
42 | return axios.get('category/getAllCategorie');
43 | }
44 | }
--------------------------------------------------------------------------------
/backend/.env.example:
--------------------------------------------------------------------------------
1 | APP_NAME=Laravel
2 | APP_ENV=local
3 | APP_KEY=
4 | APP_DEBUG=true
5 | APP_URL=http://localhost
6 |
7 | LOG_CHANNEL=stack
8 | LOG_DEPRECATIONS_CHANNEL=null
9 | LOG_LEVEL=debug
10 |
11 | DB_CONNECTION=mysql
12 | DB_HOST=127.0.0.1
13 | DB_PORT=3306
14 | DB_DATABASE=laravel
15 | DB_USERNAME=root
16 | DB_PASSWORD=
17 |
18 | BROADCAST_DRIVER=log
19 | CACHE_DRIVER=file
20 | FILESYSTEM_DISK=local
21 | QUEUE_CONNECTION=sync
22 | SESSION_DRIVER=file
23 | SESSION_LIFETIME=120
24 |
25 | MEMCACHED_HOST=127.0.0.1
26 |
27 | REDIS_HOST=127.0.0.1
28 | REDIS_PASSWORD=null
29 | REDIS_PORT=6379
30 |
31 | MAIL_MAILER=smtp
32 | MAIL_HOST=mailhog
33 | MAIL_PORT=1025
34 | MAIL_USERNAME=null
35 | MAIL_PASSWORD=null
36 | MAIL_ENCRYPTION=null
37 | MAIL_FROM_ADDRESS="hello@example.com"
38 | MAIL_FROM_NAME="${APP_NAME}"
39 |
40 | AWS_ACCESS_KEY_ID=
41 | AWS_SECRET_ACCESS_KEY=
42 | AWS_DEFAULT_REGION=us-east-1
43 | AWS_BUCKET=
44 | AWS_USE_PATH_STYLE_ENDPOINT=false
45 |
46 | PUSHER_APP_ID=
47 | PUSHER_APP_KEY=
48 | PUSHER_APP_SECRET=
49 | PUSHER_HOST=
50 | PUSHER_PORT=443
51 | PUSHER_SCHEME=https
52 | PUSHER_APP_CLUSTER=mt1
53 |
54 | VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
55 | VITE_PUSHER_HOST="${PUSHER_HOST}"
56 | VITE_PUSHER_PORT="${PUSHER_PORT}"
57 | VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
58 | VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
59 |
--------------------------------------------------------------------------------
/frontend/src/services/GererCommande/Commande.js:
--------------------------------------------------------------------------------
1 | import "@/plugins/axios";
2 | import axios from "axios";
3 |
4 | export default{
5 |
6 | AddCommande(Commande){
7 | return axios.post('commande/AddCommande',Commande);
8 | },
9 | CommandeForUser(id,code,page){
10 | return axios.get(`commande/CommandeForUser/?id=${id}&${code ? 'code='+code : ''}&page=${page}`);
11 | },
12 | deleteCommande(id){
13 | return axios.delete('commande/deleteCommande/'+id);
14 | },
15 | AllCommande(code,page){
16 | return axios.get(`commande/AllCommande?${code ? 'code='+code : ''}&page=${page}`);
17 | },
18 | AllCommandeAccpted(code,page){
19 | return axios.get(`commande/AllCommandeAccpted?${code ? 'code='+code : ''}&page=${page}`);
20 | },
21 | AllCommandeRejeter(code,page){
22 | return axios.get(`commande/AllCommandeRejeter?${code ? 'code='+code : ''}&page=${page}`);
23 | },
24 | rejeterCommande(id,iduser){
25 | return axios.delete(`commande/rejeterCommande?${iduser!=null ? 'iduser='+iduser : ''}&id=${id}`);
26 | },
27 | AccepterCommande(id,iduser){
28 | return axios.put(`commande/AccepterCommande?${iduser!=null ? 'iduser='+iduser : ''}&id=${id}`);
29 | },
30 | countCommande(){
31 | return axios.get('commande/countCommande');
32 | }
33 |
34 | }
--------------------------------------------------------------------------------
/backend/resources/js/bootstrap.js:
--------------------------------------------------------------------------------
1 | import _ from 'lodash';
2 | window._ = _;
3 |
4 | /**
5 | * We'll load the axios HTTP library which allows us to easily issue requests
6 | * to our Laravel back-end. This library automatically handles sending the
7 | * CSRF token as a header based on the value of the "XSRF" token cookie.
8 | */
9 |
10 | import axios from 'axios';
11 | window.axios = axios;
12 |
13 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
14 |
15 | /**
16 | * Echo exposes an expressive API for subscribing to channels and listening
17 | * for events that are broadcast by Laravel. Echo and event broadcasting
18 | * allows your team to easily build robust real-time web applications.
19 | */
20 |
21 | // import Echo from 'laravel-echo';
22 |
23 | // import Pusher from 'pusher-js';
24 | // window.Pusher = Pusher;
25 |
26 | // window.Echo = new Echo({
27 | // broadcaster: 'pusher',
28 | // key: import.meta.env.VITE_PUSHER_APP_KEY,
29 | // cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER ?? 'mt1',
30 | // wsHost: import.meta.env.VITE_PUSHER_HOST ? import.meta.env.VITE_PUSHER_HOST : `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`,
31 | // wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80,
32 | // wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443,
33 | // forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https',
34 | // enabledTransports: ['ws', 'wss'],
35 | // });
36 |
--------------------------------------------------------------------------------
/backend/.env:
--------------------------------------------------------------------------------
1 | APP_NAME=FoodBundle
2 | APP_ENV=local
3 | APP_KEY=base64:RN5+IHOLqb/ZSj8Q2rzh4abY0k42kL66Au9m2UXEwOg=
4 | APP_DEBUG=true
5 | APP_URL=http://localhost
6 |
7 | LOG_CHANNEL=stack
8 | LOG_DEPRECATIONS_CHANNEL=null
9 | LOG_LEVEL=debug
10 |
11 | DB_CONNECTION=mysql
12 | DB_HOST=127.0.0.1
13 | DB_PORT=3306
14 | DB_DATABASE=foodbundle
15 | DB_USERNAME=root
16 | DB_PASSWORD=
17 |
18 | APP_FRONTEND_URL='http://localhost:8081'
19 |
20 | BROADCAST_DRIVER=log
21 | CACHE_DRIVER=file
22 | FILESYSTEM_DISK=local
23 | QUEUE_CONNECTION=sync
24 | SESSION_DRIVER=file
25 | SESSION_LIFETIME=120
26 |
27 | MEMCACHED_HOST=127.0.0.1
28 |
29 | REDIS_HOST=127.0.0.1
30 | REDIS_PASSWORD=null
31 | REDIS_PORT=6379
32 |
33 | MAIL_MAILER=smtp
34 | MAIL_HOST=smtp.gmail.com
35 | MAIL_PORT=587
36 | MAIL_USERNAME=bizomejri@gmail.com
37 | MAIL_PASSWORD=cxjzwcrqdlszqyax
38 | MAIL_ENCRYPTION=tls
39 | MAIL_FROM_ADDRESS="bizomejri@gmail.com"
40 | MAIL_FROM_NAME="${APP_NAME}"
41 |
42 | AWS_ACCESS_KEY_ID=
43 | AWS_SECRET_ACCESS_KEY=
44 | AWS_DEFAULT_REGION=us-east-1
45 | AWS_BUCKET=
46 | AWS_USE_PATH_STYLE_ENDPOINT=false
47 |
48 |
49 | BROADCAST_DRIVER=pusher
50 |
51 | PUSHER_APP_ID=local
52 | PUSHER_APP_KEY=local
53 | PUSHER_APP_SECRET=local
54 | PUSHER_APP_CLUSTER=mt1
55 |
56 | VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
57 | VITE_PUSHER_HOST="${PUSHER_HOST}"
58 | VITE_PUSHER_PORT="${PUSHER_PORT}"
59 | VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
60 | VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
61 |
--------------------------------------------------------------------------------
/backend/app/Providers/RouteServiceProvider.php:
--------------------------------------------------------------------------------
1 | configureRateLimiting();
30 |
31 | $this->routes(function () {
32 | Route::middleware('api')
33 | ->prefix('api')
34 | ->group(base_path('routes/api.php'));
35 |
36 | Route::middleware('web')
37 | ->group(base_path('routes/web.php'));
38 | });
39 | }
40 |
41 | /**
42 | * Configure the rate limiters for the application.
43 | *
44 | * @return void
45 | */
46 | protected function configureRateLimiting()
47 | {
48 | RateLimiter::for('api', function (Request $request) {
49 | return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
50 | });
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/frontend/src/components/home_page/ServiceVue.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
11 |
mdi-{{ service.icon }}
12 |
{{service.name}}
13 |
{{service.desc}}
14 |
{{service.desc}}
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
44 |
45 |
--------------------------------------------------------------------------------
/backend/app/Mail/ResetPassword.php:
--------------------------------------------------------------------------------
1 | code = $code;
26 | }
27 |
28 | public function build()
29 | {
30 | return $this->subject(' Code Reset Password')
31 | ->markdown('view-email');
32 | }
33 | /**
34 | * Get the message envelope.
35 | *
36 | * @return \Illuminate\Mail\Mailables\Envelope
37 | */
38 | public function envelope()
39 | {
40 | return new Envelope(
41 | subject: 'Reset Password',
42 | );
43 | }
44 |
45 | /**
46 | * Get the message content definition.
47 | *
48 | * @return \Illuminate\Mail\Mailables\Content
49 | */
50 | public function content()
51 | {
52 | return new Content(
53 | view: 'view.name',
54 | );
55 | }
56 |
57 | /**
58 | * Get the attachments for the message.
59 | *
60 | * @return array
61 | */
62 | public function attachments()
63 | {
64 | return [];
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/frontend/src/store/StoreAuth.js:
--------------------------------------------------------------------------------
1 | import { ref,computed } from "vue"
2 | import { defineStore } from "pinia";
3 | //import router from "@/router";
4 |
5 | export const AuthStore=defineStore('auth',()=>{
6 |
7 | const token=ref(localStorage.getItem('token')??null);
8 | const isauth=ref(localStorage.getItem('token')&&localStorage.getItem('user'));
9 | const user=ref(JSON.parse(localStorage.getItem('user'))??null);
10 | const isAdmin=ref(localStorage.getItem('isAdmin')??null);
11 |
12 | const getToken=computed(()=>token.value);
13 | const getisauth=computed(()=>isauth.value);
14 | const getuser=computed(()=>user.value);
15 | const getisadmin=computed(()=>isAdmin.value);
16 |
17 | function login(t,u,admin_client){
18 | token.value=t;
19 | isauth.value=true;
20 | isAdmin.value=admin_client;
21 | user.value=u;
22 | localStorage.setItem('token',t);
23 | localStorage.setItem('isauth',true);
24 | localStorage.setItem('isAdmin',admin_client);
25 | localStorage.setItem('user',JSON.stringify(u));
26 | }
27 |
28 | function logout(){
29 | token.value=null;
30 | isauth.value=false;
31 | isAdmin.value=null;
32 | user.value=null;
33 | localStorage.removeItem('token');
34 | localStorage.removeItem('isauth');
35 | localStorage.removeItem('isAdmin');
36 | localStorage.removeItem('user');
37 | //router.push('login');
38 | }
39 |
40 | return {login,logout,token,user,isauth,isAdmin,getToken,getisadmin,getisauth,getuser}
41 |
42 | })
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/backend/app/Http/Controllers/Auth/LoginUser.php:
--------------------------------------------------------------------------------
1 | $request->email, 'password' => $request->password])) {
16 | $user = Auth::user();
17 | if (!$user->hasVerifiedEmail()) {
18 | return response()->json(['data' => "votre email n'est pas vérifié", 'status' => "email"], 401);
19 | }
20 | $token = $user->createToken('api_token')->plainTextToken;
21 | $respnose = [
22 | 'token' => $token,
23 | 'user' => $user,
24 | 'isAdmin' => $user->Isadmin
25 | ];
26 | return response()->json(['data' => $respnose], 200);
27 | } else {
28 | return response()->json(['data' => "Utilisateur non trouvé", 'status' => "user"], 401);
29 | }
30 | }
31 |
32 | public function exist_email($email)
33 | {
34 | $user = User::where('email', $email)->first();
35 | if ($user) {
36 | return response()->json([
37 | 'success' => false,
38 | 'message' => 'email already exists',
39 | 'data' => []
40 | ], 201);
41 | } else {
42 | return response()->json([
43 | 'success' => true,
44 | 'message' => 'email not exists',
45 | 'data' => []
46 | ]);
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/frontend/src/services/GererOption/option.js:
--------------------------------------------------------------------------------
1 | import "@/plugins/axios";
2 | import axios from "axios";
3 |
4 |
5 | export default{
6 |
7 | deleteOptionSpecifique(id){
8 | return axios.delete('option/deleteOptionSpecifique/'+id);
9 | },
10 |
11 | deleteOption(id){
12 | return axios.delete('option/deleteOption/'+id);
13 | },
14 |
15 | UpdateOption(id,option){
16 | return axios.post('option/UpdateOption/'+id,option);
17 | },
18 |
19 | UpdateOptionSpecifique(id,option){
20 | return axios.post('option/UpdateOptionSpecifique/'+id,option);
21 | },
22 |
23 | findOptionByIid(id){
24 | return axios.get('option/findOptionByIid/'+id);
25 | },
26 |
27 | addOption(option){
28 | return axios.post('option/addOption',option);
29 | },
30 |
31 | addOptionSpecifique(option){
32 | return axios.post('option/addOptionSpecifique',option);
33 | },
34 |
35 | getOptionByIdCategory(category){
36 | return axios.get('option/getOptionByIdCategory/'+category.id);
37 | },
38 |
39 | countOption(){
40 | return axios.get('option/countOption');
41 | },
42 |
43 | CountOptionSpecifique(){
44 | return axios.get('option/CountOptionSpecifique');
45 | },
46 |
47 | getOptionGlobal(id,search,page){
48 | return axios.get(`option/getOptionGlobal?${search ? 'search='+search : ''}&id=${id!=-1 ? id :-1}&page=${page}`);
49 | },
50 |
51 | getOptionSpecifique(id,search,page){
52 | return axios.get(`option/getOptionSpecifique?${search ? 'search='+search : ''}&id=${id!=-1 ? id :-1}&page=${page}`);
53 | },
54 | getAllOption(){
55 | return axios.get('option/getAlloption');
56 | }
57 |
58 |
59 |
60 |
61 | }
--------------------------------------------------------------------------------
/backend/config/hashing.php:
--------------------------------------------------------------------------------
1 | 'bcrypt',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Bcrypt Options
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may specify the configuration options that should be used when
26 | | passwords are hashed using the Bcrypt algorithm. This will allow you
27 | | to control the amount of time it takes to hash the given password.
28 | |
29 | */
30 |
31 | 'bcrypt' => [
32 | 'rounds' => env('BCRYPT_ROUNDS', 10),
33 | ],
34 |
35 | /*
36 | |--------------------------------------------------------------------------
37 | | Argon Options
38 | |--------------------------------------------------------------------------
39 | |
40 | | Here you may specify the configuration options that should be used when
41 | | passwords are hashed using the Argon algorithm. These will allow you
42 | | to control the amount of time it takes to hash the given password.
43 | |
44 | */
45 |
46 | 'argon' => [
47 | 'memory' => 65536,
48 | 'threads' => 1,
49 | 'time' => 4,
50 | ],
51 |
52 | ];
53 |
--------------------------------------------------------------------------------
/frontend/src/services/GererProduct/GererProduct.js:
--------------------------------------------------------------------------------
1 | import "@/plugins/axios";
2 | import axios from "axios";
3 |
4 | export default{
5 |
6 | deleteProduct(id){
7 | return axios.delete('product/deleteProduct/'+id);
8 | },
9 |
10 | UpdateProduct(id,Product){
11 | return axios.post('product/UpdateProduct/'+id,Product);
12 | },
13 |
14 | Add_Product(product){
15 | return axios.post('product/Add_Product',product);
16 | },
17 |
18 | GetProductCategoryOption(idcategory,search,page){
19 | return axios.get(`product/GetProductCategoryOption?${search ? 'search='+search : ''}&idcategory=${idcategory!=-1 ? idcategory : -1}&page=${page}`);
20 | },
21 |
22 | findProductByIid(idProduct){
23 | return axios.get('product/findProductByIid/'+idProduct);
24 | },
25 |
26 | countproduct(){
27 | return axios.get('product/countproduct');
28 | },
29 |
30 | getallProduct(){
31 | return axios.get('product/AllProduct');
32 | },
33 |
34 | getProductByIdCategory(id){
35 | return axios.get('product/getProductByIdCategory/'+id);
36 | },
37 |
38 | getProducts(){
39 | return axios.get('product/getALLproduct');
40 | },
41 |
42 | GetProudctOptionSpecifiqueCategory(id,search,prix,typeordered,page){
43 | return axios.get(`product/GetProudctOptionSpecifiqueCategory?id=${id}&${search ? 'search='+search : ''}&prix=${prix}&${typeordered ? 'typeordered='+typeordered : ''}&page=${page}`);
44 | },
45 |
46 | Addrate(id){
47 | return axios.post('product/addrate/',id);
48 | },
49 |
50 | getrate(){
51 | return axios.get('product/getrate');
52 | },
53 |
54 | Avgrate(id){
55 | return axios.get('product/Avgrate/'+id);
56 | },
57 |
58 |
59 | }
--------------------------------------------------------------------------------
/frontend/src/plugins/axios.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | import Vue from 'vue';
4 | import axios from "axios";
5 | import {AuthStore} from "../store/StoreAuth"
6 | // Full config: https://github.com/axios/axios#request-config
7 | axios.defaults.baseURL = process.env.baseURL || process.env.apiUrl || 'http://localhost:8000/api/';
8 | // axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;
9 | // axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
10 |
11 | let config = {
12 | // baseURL: process.env.baseURL || process.env.apiUrl || ""
13 | // timeout: 60 * 1000, // Timeout
14 | // withCredentials: true, // Check cross-site Access-Control
15 | };
16 |
17 | const _axios = axios.create(config);
18 |
19 | _axios.interceptors.request.use(
20 | function(config) {
21 | const store=AuthStore();
22 | config.headers.Authorization = `Bearer ${store.token}`;
23 | // Do something before request is sent
24 | return config;
25 | },
26 | function(error) {
27 | // Do something with request error
28 | return Promise.reject(error);
29 | }
30 | );
31 |
32 | // Add a response interceptor
33 | _axios.interceptors.response.use(
34 | function(response) {
35 | // Do something with response data
36 | return response;
37 | },
38 | function(error) {
39 | // Do something with response error
40 | return Promise.reject(error);
41 | }
42 | );
43 |
44 | Plugin.install = function(Vue, options) {
45 | Vue.axios = _axios;
46 | window.axios = _axios;
47 | Object.defineProperties(Vue.prototype, {
48 | axios: {
49 | get() {
50 | return _axios;
51 | }
52 | },
53 | $axios: {
54 | get() {
55 | return _axios;
56 | }
57 | },
58 | });
59 | };
60 |
61 | Vue.use(Plugin)
62 |
63 | export default Plugin;
64 |
--------------------------------------------------------------------------------
/backend/app/Http/Controllers/Auth/ResetPassword/ChangerPassword.php:
--------------------------------------------------------------------------------
1 | password_token)->where('email',$request->email)->first();
15 | if(!$checkCode){
16 | return response(['message' => 'E-mail ou code incorrect'], 404);
17 | }
18 | if($checkCode->password_token_send_at > now()->addHour()){
19 | $checkCode->password_token=Null;
20 | $checkCode->password_token_send_at=Null;
21 | $checkCode->save();
22 | return response(['message' => 'le code des mots de passe a expiré'], 422);
23 | }
24 |
25 | $checkCode->password=bcrypt($request->password);
26 | $checkCode->password_token=Null;
27 | $checkCode->password_token_send_at=Null;
28 | $checkCode->save();
29 | return response(['message' =>'votre mot de passe a été changé'], 200);
30 | }
31 |
32 | public function exist_code($code){
33 | $user=User::where('password_token',$code)->first();
34 | if($user){
35 | return response()->json([
36 | 'success' => false,
37 | 'message' => 'code exists',
38 | 'data' => []
39 | ], 201);
40 | } else {
41 | return response()->json([
42 | 'success' => true,
43 | 'message' => 'code not exists',
44 | 'data' => []
45 | ]);
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/backend/app/Http/Controllers/Auth/Verifyemail/VerificationEmail.php:
--------------------------------------------------------------------------------
1 | First();
15 | if (!$user->hasVerifiedEmail()) {
16 | $user->markEmailAsVerified();
17 | return response()->json(['data'=>"Email verifé avec succès"],200);
18 | } else {
19 | return response()->json(['data'=>"Email est déja verifé"],200);
20 | }
21 | }
22 |
23 | public function renvoyer($email)
24 | {
25 | $user = User::where('email', $email)->first();
26 | if ($user->hasVerifiedEmail()) {
27 | return response()->json(["data" => "email est déja vérifé"], 400);
28 | }
29 | $user->sendEmailVerify();
30 | return response()->json(["data" => "lien de vérification envoé avec succès"], 200);
31 | }
32 |
33 | public function sendmailChanger( $email){
34 | $user = User::where('email', $email)->first();
35 | $user->sendEmailChangerEmail();
36 | }
37 |
38 | public function updated(request $request){
39 | $user = User::where('email', $request->email)->first();
40 | if($user){
41 | $user->update([
42 | 'email'=>$request->email_new,
43 | 'email_verified_at'=>Null
44 | ]);
45 | $user->sendEmailVerify();
46 | return response()->json(["data" =>$user], 200);
47 | }else{
48 | return response()->json(["data" => "User Not Found"], 404);
49 | }
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/backend/bootstrap/app.php:
--------------------------------------------------------------------------------
1 | singleton(
30 | Illuminate\Contracts\Http\Kernel::class,
31 | App\Http\Kernel::class
32 | );
33 |
34 | $app->singleton(
35 | Illuminate\Contracts\Console\Kernel::class,
36 | App\Console\Kernel::class
37 | );
38 |
39 | $app->singleton(
40 | Illuminate\Contracts\Debug\ExceptionHandler::class,
41 | App\Exceptions\Handler::class
42 | );
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Return The Application
47 | |--------------------------------------------------------------------------
48 | |
49 | | This script returns the application instance. The instance is given to
50 | | the calling script so we can separate the building of the instances
51 | | from the actual running of the application and sending responses.
52 | |
53 | */
54 |
55 | return $app;
56 |
--------------------------------------------------------------------------------
/backend/artisan:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | make(Illuminate\Contracts\Console\Kernel::class);
34 |
35 | $status = $kernel->handle(
36 | $input = new Symfony\Component\Console\Input\ArgvInput,
37 | new Symfony\Component\Console\Output\ConsoleOutput
38 | );
39 |
40 | /*
41 | |--------------------------------------------------------------------------
42 | | Shutdown The Application
43 | |--------------------------------------------------------------------------
44 | |
45 | | Once Artisan has finished running, we will fire off the shutdown events
46 | | so that any final work may be done by the application before we shut
47 | | down the process. This is the last thing to happen to the request.
48 | |
49 | */
50 |
51 | $kernel->terminate($input, $status);
52 |
53 | exit($status);
54 |
--------------------------------------------------------------------------------
/backend/app/Http/Controllers/notification/ControllerNotification.php:
--------------------------------------------------------------------------------
1 | user()->id)->where('etat',0)->get();
14 | return response()->json($notification,200);
15 | }
16 |
17 | public function getNotif(Request $request){
18 | $notification=Notification::where('user_id',$request->user()->id)->where('etat',0)->get();
19 | //$notification = $request->user()->notifications()->where("etat",0)->get();
20 | return response()->json($notification,200);
21 | }
22 |
23 | public function getAllNotification(Request $request){
24 | $notification=Notification::where('user_id',$request->user()->id)->orderBy('etat')->get();
25 | return response()->json($notification,200);
26 | }
27 |
28 | public function changeretat($id){
29 | $notification=Notification::find($id);
30 | if($notification){
31 | $notification->update([
32 | 'etat'=>1
33 | ]);
34 | }else{
35 | return response()->json(['message'=>"Notification Not found"],404);
36 | }
37 | }
38 | public function deleteNotification($id){
39 | $notification=Notification::find($id);
40 | if($notification){
41 | $notification->delete();
42 | return response()->json(['message'=>"delete with success"],200);
43 | }else{
44 | return response()->json(['message'=>"Notification Not found"],404);
45 | }
46 | }
47 |
48 | public function deleteAllNotif($id){
49 | $notification=Notification::where('user_id','=',$id)->delete();
50 | return response()->json(['data'=>$notification],200);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/backend/public/index.php:
--------------------------------------------------------------------------------
1 | make(Kernel::class);
50 |
51 | $response = $kernel->handle(
52 | $request = Request::capture()
53 | )->send();
54 |
55 | $kernel->terminate($request, $response);
56 |
--------------------------------------------------------------------------------
/frontend/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "frontend",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build",
8 | "lint": "vue-cli-service lint"
9 | },
10 | "dependencies": {
11 | "@vuelidate/core": "^2.0.0",
12 | "@vuelidate/validators": "^2.0.0",
13 | "animate.css": "^4.1.1",
14 | "aos": "^2.3.4",
15 | "bootstrap-vue": "^2.1.0",
16 | "chart.js": "^4.2.0",
17 | "core-js": "^3.8.3",
18 | "jspdf": "^2.5.1",
19 | "jspdf-autotable": "^3.5.28",
20 | "jspdf-html2canvas": "^1.4.9",
21 | "laravel-echo": "^1.15.0",
22 | "number-to-words": "^1.2.4",
23 | "pinia": "^2.0.28",
24 | "pusher-js": "^8.0.1",
25 | "vue": "^2.6.14",
26 | "vue-chartjs": "^5.2.0",
27 | "vue-confetti": "^2.3.0",
28 | "vue-router": "^3.5.1",
29 | "vuelidate": "^0.7.7",
30 | "vuetify": "^2.6.0",
31 | "vuex": "^3.6.2",
32 | "written-number": "^0.11.1"
33 | },
34 | "devDependencies": {
35 | "@babel/core": "^7.12.16",
36 | "@babel/eslint-parser": "^7.12.16",
37 | "@babel/polyfill": "^7.7.0",
38 | "@mdi/font": "^7.1.96",
39 | "@vue/cli-plugin-babel": "~5.0.0",
40 | "@vue/cli-plugin-eslint": "~5.0.0",
41 | "@vue/cli-plugin-router": "~5.0.0",
42 | "@vue/cli-plugin-vuex": "~5.0.0",
43 | "@vue/cli-service": "~5.0.0",
44 | "axios": "^0.18.0",
45 | "bootstrap": "^4.3.1",
46 | "eslint": "^7.32.0",
47 | "eslint-plugin-vue": "^8.0.3",
48 | "material-design-icons-iconfont": "^6.7.0",
49 | "mutationobserver-shim": "^0.3.3",
50 | "popper.js": "^1.16.0",
51 | "portal-vue": "^2.1.6",
52 | "sass": "^1.32.7",
53 | "sass-loader": "^12.0.0",
54 | "vue-cli-plugin-axios": "~0.0.4",
55 | "vue-cli-plugin-bootstrap": "~0.4.0",
56 | "vue-cli-plugin-vuetify": "~2.5.8",
57 | "vue-template-compiler": "^2.6.14",
58 | "vuetify-loader": "^1.7.0"
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/frontend/src/services/GererUser/GererUser.js:
--------------------------------------------------------------------------------
1 | import "@/plugins/axios";
2 | import Axios from "axios";
3 |
4 | export default{
5 |
6 | CoutUser(){
7 | return Axios.get('user/countUser');
8 | },
9 |
10 | getallUser(search){
11 | // return Axios.get(`user/getuser?${search ? "search="+search : ""}`);
12 | return Axios.get("user/getuser");
13 | },
14 |
15 | deleteUser(id){
16 | return Axios.delete('user/deleteUser/'+id);
17 | },
18 |
19 | UpdateUser(user){
20 | let data=new FormData();
21 | data.append('name',user.name);
22 | data.append('lastname',user.lastname);
23 | data.append('email',user.email);
24 | data.append('photo',user.photo);
25 | data.append('tlf',user.tlf);
26 | data.append('avatarupload',user.avatarupload);
27 | const config={
28 | headers:{
29 | "Content-Type":"multipart/form-data",
30 | }
31 | };
32 |
33 | return Axios.post('user/Updateuser',data,config);
34 | },
35 |
36 | addLiked(id){
37 | return Axios.post('user/AddLiked/'+id);
38 | },
39 |
40 | deleteFavorite(id){
41 | return Axios.delete('user/deleteFavorite/'+id);
42 | },
43 |
44 | checkLiked(id){
45 | return Axios.get('user/checkLiked/'+id);
46 | },
47 |
48 | countLiked(id){
49 | return Axios.get('user/countLiked/'+id);
50 | },
51 |
52 | GetAllLikedProduct(id){
53 | return Axios.get('user/GetAllLikedProduct/'+id);
54 | },
55 |
56 | getAllProductLiekd(id,page){
57 | return Axios.get(`user/getAllProductLiekd/${id}&page=${page}`);
58 | },
59 |
60 | same_password(password){
61 | return Axios.get('user/samePassword/'+password);
62 | },
63 | changer_motdepasse(password){
64 | return Axios.put('user/changerPassword/'+password);
65 | }
66 |
67 | }
--------------------------------------------------------------------------------
/backend/app/Notifications/changer_email.php:
--------------------------------------------------------------------------------
1 | subject('Confirmer Pour Modifier Votre Email')
49 | ->line('cliquer sur le lien dessous')
50 | ->action('Changer Email',$link.$verificationurl);
51 | }
52 |
53 | /**
54 | * Get the array representation of the notification.
55 | *
56 | * @param mixed $notifiable
57 | * @return array
58 | */
59 | public function toArray($notifiable)
60 | {
61 | return [
62 | //
63 | ];
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/backend/app/Notifications/notifications.php:
--------------------------------------------------------------------------------
1 | subject('Confirmé Email')
50 | ->line('cliquer sur le lien dessous')
51 | ->action('Vérifier Votre Email ',$link.$verificationurl);
52 | }
53 |
54 | /**
55 | * Get the array representation of the notification.
56 | *
57 | * @param mixed $notifiable
58 | * @return array
59 | */
60 | public function toArray($notifiable)
61 | {
62 | return [
63 | //
64 | ];
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/frontend/src/components/home_page/FooterVue.vue:
--------------------------------------------------------------------------------
1 |
2 |
32 |
33 |
34 |
50 |
51 |
--------------------------------------------------------------------------------
/backend/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "laravel/laravel",
3 | "type": "project",
4 | "description": "The Laravel Framework.",
5 | "keywords": ["framework", "laravel"],
6 | "license": "MIT",
7 | "require": {
8 | "php": "^8.0.2",
9 | "ably/ably-php": "^1.1",
10 | "beyondcode/laravel-websockets": "^1.14",
11 | "guzzlehttp/guzzle": "^7.2",
12 | "laravel/framework": "^9.19",
13 | "laravel/sanctum": "^3.0",
14 | "laravel/tinker": "^2.7",
15 | "pusher/pusher-php-server": "^7"
16 | },
17 | "require-dev": {
18 | "fakerphp/faker": "^1.9.1",
19 | "laravel/pint": "^1.0",
20 | "laravel/sail": "^1.0.1",
21 | "mockery/mockery": "^1.4.4",
22 | "nunomaduro/collision": "^6.1",
23 | "phpunit/phpunit": "^9.5.10",
24 | "spatie/laravel-ignition": "^1.0"
25 | },
26 | "autoload": {
27 | "psr-4": {
28 | "App\\": "app/",
29 | "Database\\Factories\\": "database/factories/",
30 | "Database\\Seeders\\": "database/seeders/"
31 | }
32 | },
33 | "autoload-dev": {
34 | "psr-4": {
35 | "Tests\\": "tests/"
36 | }
37 | },
38 | "scripts": {
39 | "post-autoload-dump": [
40 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
41 | "@php artisan package:discover --ansi"
42 | ],
43 | "post-update-cmd": [
44 | "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
45 | ],
46 | "post-root-package-install": [
47 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
48 | ],
49 | "post-create-project-cmd": [
50 | "@php artisan key:generate --ansi"
51 | ]
52 | },
53 | "extra": {
54 | "laravel": {
55 | "dont-discover": []
56 | }
57 | },
58 | "config": {
59 | "optimize-autoloader": true,
60 | "preferred-install": "dist",
61 | "sort-packages": true,
62 | "allow-plugins": {
63 | "pestphp/pest-plugin": true
64 | }
65 | },
66 | "minimum-stability": "dev",
67 | "prefer-stable": true
68 | }
69 |
--------------------------------------------------------------------------------
/backend/app/Models/User.php:
--------------------------------------------------------------------------------
1 |
25 | */
26 | protected $guarded=[];
27 | /*
28 | protected $fillable = [
29 | 'name',
30 | 'email',
31 | 'password',
32 | 'lastname',
33 | 'numero_tlf',
34 | 'Photo',
35 | 'Isadmin'
36 | ];
37 | */
38 |
39 | public function sendEmailVerify()
40 | {
41 | $this->notify(new NotificationsNotifications());
42 | }
43 |
44 | public function sendEmailChangerEmail()
45 | {
46 | $this->notify(new NotificationsChanger_email());
47 | }
48 |
49 | public function Favorites(){
50 | return $this->hasMany(favorite::class);
51 | }
52 |
53 | public function notifications(){
54 | return $this->hasMany(Notification::class);
55 | }
56 |
57 |
58 | public function rates(){
59 | return $this->hasMany(Rate::class);
60 | }
61 |
62 | public function commandes(){
63 | return $this->hasMany(Commande::class);
64 | }
65 |
66 | /**
67 | * The attributes that should be hidden for serialization.
68 | *
69 | * @var array
70 | */
71 | protected $hidden = [
72 | 'password',
73 | 'remember_token',
74 | ];
75 |
76 | /**
77 | * The attributes that should be cast.
78 | *
79 | * @var array
80 | */
81 | protected $casts = [
82 | 'email_verified_at' => 'datetime',
83 | ];
84 | }
85 |
--------------------------------------------------------------------------------
/backend/config/broadcasting.php:
--------------------------------------------------------------------------------
1 | env('BROADCAST_DRIVER', 'pusher'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Broadcast Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the broadcast connections that will be used
26 | | to broadcast events to other systems or over websockets. Samples of
27 | | each available type of connection are provided inside this array.
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'pusher' => [
34 | 'driver' => 'pusher',
35 | 'key' => env('PUSHER_APP_KEY'),
36 | 'secret' => env('PUSHER_APP_SECRET'),
37 | 'app_id' => env('PUSHER_APP_ID'),
38 | 'options' => [
39 | 'cluster' => env('PUSHER_APP_CLUSTER'),
40 | 'encrypted' => true,
41 | 'host' => '127.0.0.1',
42 | 'port' => 6001,
43 | 'scheme' => 'http',
44 | // 'curl_options' => [
45 | // CURLOPT_SSL_VERIFYHOST => 0,
46 | // CURLOPT_SSL_VERIFYPEER => 0,
47 | // ],
48 | // 'useTLS' => true,
49 | ],
50 | ],
51 |
52 | 'ably' => [
53 | 'driver' => 'ably',
54 | 'key' => env('ABLY_KEY'),
55 | ],
56 |
57 | 'redis' => [
58 | 'driver' => 'redis',
59 | 'connection' => 'default',
60 | ],
61 |
62 | 'log' => [
63 | 'driver' => 'log',
64 | ],
65 |
66 | 'null' => [
67 | 'driver' => 'null',
68 | ],
69 |
70 | ],
71 |
72 | ];
73 |
--------------------------------------------------------------------------------
/backend/config/sanctum.php:
--------------------------------------------------------------------------------
1 | explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
19 | '%s%s',
20 | 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
21 | Sanctum::currentApplicationUrlWithPort()
22 | ))),
23 |
24 | /*
25 | |--------------------------------------------------------------------------
26 | | Sanctum Guards
27 | |--------------------------------------------------------------------------
28 | |
29 | | This array contains the authentication guards that will be checked when
30 | | Sanctum is trying to authenticate a request. If none of these guards
31 | | are able to authenticate the request, Sanctum will use the bearer
32 | | token that's present on an incoming request for authentication.
33 | |
34 | */
35 |
36 | 'guard' => ['web'],
37 |
38 | /*
39 | |--------------------------------------------------------------------------
40 | | Expiration Minutes
41 | |--------------------------------------------------------------------------
42 | |
43 | | This value controls the number of minutes until an issued token will be
44 | | considered expired. If this value is null, personal access tokens do
45 | | not expire. This won't tweak the lifetime of first-party sessions.
46 | |
47 | */
48 |
49 | 'expiration' => null,
50 |
51 | /*
52 | |--------------------------------------------------------------------------
53 | | Sanctum Middleware
54 | |--------------------------------------------------------------------------
55 | |
56 | | When authenticating your first-party SPA with Sanctum you may need to
57 | | customize some of the middleware Sanctum uses while processing the
58 | | request. You may change the middleware listed below as required.
59 | |
60 | */
61 |
62 | 'middleware' => [
63 | 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class,
64 | 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class,
65 | ],
66 |
67 | ];
68 |
--------------------------------------------------------------------------------
/backend/config/filesystems.php:
--------------------------------------------------------------------------------
1 | env('FILESYSTEM_DISK', 'local'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Filesystem Disks
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure as many filesystem "disks" as you wish, and you
24 | | may even configure multiple disks of the same driver. Defaults have
25 | | been set up for each driver as an example of the required values.
26 | |
27 | | Supported Drivers: "local", "ftp", "sftp", "s3"
28 | |
29 | */
30 |
31 | 'disks' => [
32 |
33 | 'local' => [
34 | 'driver' => 'local',
35 | 'root' => storage_path('app'),
36 | 'throw' => false,
37 | ],
38 |
39 | 'public' => [
40 | 'driver' => 'local',
41 | 'root' => storage_path('app/public'),
42 | 'url' => env('APP_URL').'/storage',
43 | 'visibility' => 'public',
44 | 'throw' => false,
45 | ],
46 |
47 | 's3' => [
48 | 'driver' => 's3',
49 | 'key' => env('AWS_ACCESS_KEY_ID'),
50 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
51 | 'region' => env('AWS_DEFAULT_REGION'),
52 | 'bucket' => env('AWS_BUCKET'),
53 | 'url' => env('AWS_URL'),
54 | 'endpoint' => env('AWS_ENDPOINT'),
55 | 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
56 | 'throw' => false,
57 | ],
58 |
59 | ],
60 |
61 | /*
62 | |--------------------------------------------------------------------------
63 | | Symbolic Links
64 | |--------------------------------------------------------------------------
65 | |
66 | | Here you may configure the symbolic links that will be created when the
67 | | `storage:link` Artisan command is executed. The array keys should be
68 | | the locations of the links and the values should be their targets.
69 | |
70 | */
71 |
72 | 'links' => [
73 | public_path('storage') => storage_path('app/public'),
74 | ],
75 |
76 | ];
77 |
--------------------------------------------------------------------------------
/frontend/src/components/ProfilAdmin/option/AddOption.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Ajouter Option
9 |
10 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/backend/app/Http/Kernel.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | protected $middleware = [
17 | // \App\Http\Middleware\TrustHosts::class,
18 | \App\Http\Middleware\TrustProxies::class,
19 | \Illuminate\Http\Middleware\HandleCors::class,
20 | \App\Http\Middleware\PreventRequestsDuringMaintenance::class,
21 | \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
22 | \App\Http\Middleware\TrimStrings::class,
23 | \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
24 | ];
25 |
26 | /**
27 | * The application's route middleware groups.
28 | *
29 | * @var array>
30 | */
31 | protected $middlewareGroups = [
32 | 'web' => [
33 | \App\Http\Middleware\EncryptCookies::class,
34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
35 | \Illuminate\Session\Middleware\StartSession::class,
36 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
37 | \App\Http\Middleware\VerifyCsrfToken::class,
38 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
39 | ],
40 |
41 | 'api' => [
42 | // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
43 | // 'throttle:api',
44 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
45 | ],
46 | ];
47 |
48 | /**
49 | * The application's route middleware.
50 | *
51 | * These middleware may be assigned to groups or used individually.
52 | *
53 | * @var array
54 | */
55 | protected $routeMiddleware = [
56 | 'auth' => \App\Http\Middleware\Authenticate::class,
57 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
58 | 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
59 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
60 | 'can' => \Illuminate\Auth\Middleware\Authorize::class,
61 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
62 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
63 | 'signed' => \App\Http\Middleware\ValidateSignature::class,
64 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
65 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
66 | ];
67 | }
68 |
--------------------------------------------------------------------------------
/backend/config/queue.php:
--------------------------------------------------------------------------------
1 | env('QUEUE_CONNECTION', 'sync'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Queue Connections
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure the connection information for each server that
24 | | is used by your application. A default configuration has been added
25 | | for each back-end shipped with Laravel. You are free to add more.
26 | |
27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'sync' => [
34 | 'driver' => 'sync',
35 | ],
36 |
37 | 'database' => [
38 | 'driver' => 'database',
39 | 'table' => 'jobs',
40 | 'queue' => 'default',
41 | 'retry_after' => 90,
42 | 'after_commit' => false,
43 | ],
44 |
45 | 'beanstalkd' => [
46 | 'driver' => 'beanstalkd',
47 | 'host' => 'localhost',
48 | 'queue' => 'default',
49 | 'retry_after' => 90,
50 | 'block_for' => 0,
51 | 'after_commit' => false,
52 | ],
53 |
54 | 'sqs' => [
55 | 'driver' => 'sqs',
56 | 'key' => env('AWS_ACCESS_KEY_ID'),
57 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
58 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
59 | 'queue' => env('SQS_QUEUE', 'default'),
60 | 'suffix' => env('SQS_SUFFIX'),
61 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
62 | 'after_commit' => false,
63 | ],
64 |
65 | 'redis' => [
66 | 'driver' => 'redis',
67 | 'connection' => 'default',
68 | 'queue' => env('REDIS_QUEUE', 'default'),
69 | 'retry_after' => 90,
70 | 'block_for' => null,
71 | 'after_commit' => false,
72 | ],
73 |
74 | ],
75 |
76 | /*
77 | |--------------------------------------------------------------------------
78 | | Failed Queue Jobs
79 | |--------------------------------------------------------------------------
80 | |
81 | | These options configure the behavior of failed queue job logging so you
82 | | can control which database and table are used to store the jobs that
83 | | have failed. You may change them to any database / table you wish.
84 | |
85 | */
86 |
87 | 'failed' => [
88 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
89 | 'database' => env('DB_CONNECTION', 'mysql'),
90 | 'table' => 'failed_jobs',
91 | ],
92 |
93 | ];
94 |
--------------------------------------------------------------------------------
/frontend/src/router/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import VueRouter from 'vue-router'
3 | import HomeView from '../views/HomeView.vue'
4 | import login from '../views/Auth/LoginView.vue'
5 | import signup from '../views/Auth/SignUpView.vue'
6 | import allOrderedProduct from '../views/ProfilClient/AllOrderedView.vue'
7 | import AllFavoriteProduct from '../views/ProfilClient/AllFavoriteView.vue'
8 | import dashboard from '../views/ProfilAdmin/dashboard/DashboardView.vue'
9 | import editProfil from "@/views/ProfilClient/EditProfilView.vue"
10 | import ConsulteMenuView from "@/views/Menu/ConsulteMenuView.vue"
11 | import PanierView from "@/views/Menu/PanierView.vue"
12 | import ConfirmerCommandeView from "@/views/Menu/ConfirmerCommandeView.vue"
13 | import CommandeView from "@/views/ProfilAdmin/Commande/CommandeView.vue"
14 | import forgot_password from "@/views/Auth/ResetPassword/ForgotPasswordView.vue"
15 | import changer_password from "@/views/Auth/ResetPassword/ChangerPasswordView.vue"
16 | import { pinia } from '@/main'
17 | import { AuthStore } from "@/store/StoreAuth.js";
18 |
19 | Vue.use(VueRouter)
20 | const routes = [
21 | {
22 | path: '/',
23 | name: 'home',
24 | component: HomeView
25 | },
26 | {
27 | path: '/CommandeView',
28 | name: 'CommandeView',
29 | component: CommandeView
30 | },
31 | {
32 | path: '/PanierView',
33 | name: 'PanierView',
34 | component: PanierView
35 | },
36 | {
37 | path: '/ConfirmerCommandeView',
38 | name: 'ConfirmerCommandeView',
39 | component: ConfirmerCommandeView
40 | },
41 | {
42 | path: '/ConsulteMenuView/:id',
43 | name: 'ConsulteMenuView',
44 | component: ConsulteMenuView
45 | },
46 | {
47 | path: '/login',
48 | name: 'login',
49 | component: login
50 | },
51 | {
52 | path: '/forgot_password',
53 | name: 'forgot_password',
54 | component: forgot_password
55 | },
56 | {
57 | path: '/changer_password',
58 | name: 'changer_password',
59 | component: changer_password
60 | },
61 | {
62 | path: '/signup',
63 | name: 'signup',
64 | component: signup
65 | },
66 | {
67 | path: '/allOrderedProduct',
68 | name: 'allOrderedProduct',
69 | component: allOrderedProduct,
70 | meta: { requiresClient: true },
71 | },
72 | {
73 | path: '/AllFavoriteProduct',
74 | name: 'AllFavoriteProduct',
75 | component: AllFavoriteProduct,
76 | meta: { requiresClient: true },
77 | },
78 | {
79 | path: '/editProfil',
80 | name: 'editProfil',
81 | component: editProfil,
82 | meta: { requiresAuth: true },
83 | },
84 | {
85 | path: '/dashboard',
86 | name: 'dashboard',
87 | component: dashboard,
88 | meta: { requiresAdmin: true },
89 | },
90 | ]
91 |
92 | const router = new VueRouter({
93 | mode: 'history',
94 | base: process.env.BASE_URL,
95 | routes
96 | })
97 |
98 | router.beforeEach((to, from, next) => {
99 | const auth=AuthStore(pinia);
100 | if (to.matched.some((record) => record.meta.requiresAdmin)) {
101 | if (auth.getisadmin) {
102 | next();
103 | return;
104 | }
105 | next({
106 | name: "login",
107 | });
108 | }else if (to.matched.some((record) => record.meta.requiresAuth)) {
109 | if (auth.getisauth) {
110 | next();
111 | return;
112 | }
113 | next({
114 | name: "login",
115 | });
116 | } else if (to.matched.some((record) => record.meta.requiresClient)) {
117 | if (auth.getisadmin==false) {
118 | next();
119 | return;
120 | }
121 | next({
122 | name: "login",
123 | });
124 | } else {
125 | next();
126 | }
127 |
128 | });
129 |
130 |
131 | export default router
132 |
--------------------------------------------------------------------------------
/backend/config/cache.php:
--------------------------------------------------------------------------------
1 | env('CACHE_DRIVER', 'file'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Cache Stores
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the cache "stores" for your application as
26 | | well as their drivers. You may even define multiple stores for the
27 | | same cache driver to group types of items stored in your caches.
28 | |
29 | | Supported drivers: "apc", "array", "database", "file",
30 | | "memcached", "redis", "dynamodb", "octane", "null"
31 | |
32 | */
33 |
34 | 'stores' => [
35 |
36 | 'apc' => [
37 | 'driver' => 'apc',
38 | ],
39 |
40 | 'array' => [
41 | 'driver' => 'array',
42 | 'serialize' => false,
43 | ],
44 |
45 | 'database' => [
46 | 'driver' => 'database',
47 | 'table' => 'cache',
48 | 'connection' => null,
49 | 'lock_connection' => null,
50 | ],
51 |
52 | 'file' => [
53 | 'driver' => 'file',
54 | 'path' => storage_path('framework/cache/data'),
55 | ],
56 |
57 | 'memcached' => [
58 | 'driver' => 'memcached',
59 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
60 | 'sasl' => [
61 | env('MEMCACHED_USERNAME'),
62 | env('MEMCACHED_PASSWORD'),
63 | ],
64 | 'options' => [
65 | // Memcached::OPT_CONNECT_TIMEOUT => 2000,
66 | ],
67 | 'servers' => [
68 | [
69 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
70 | 'port' => env('MEMCACHED_PORT', 11211),
71 | 'weight' => 100,
72 | ],
73 | ],
74 | ],
75 |
76 | 'redis' => [
77 | 'driver' => 'redis',
78 | 'connection' => 'cache',
79 | 'lock_connection' => 'default',
80 | ],
81 |
82 | 'dynamodb' => [
83 | 'driver' => 'dynamodb',
84 | 'key' => env('AWS_ACCESS_KEY_ID'),
85 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
86 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
87 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
88 | 'endpoint' => env('DYNAMODB_ENDPOINT'),
89 | ],
90 |
91 | 'octane' => [
92 | 'driver' => 'octane',
93 | ],
94 |
95 | ],
96 |
97 | /*
98 | |--------------------------------------------------------------------------
99 | | Cache Key Prefix
100 | |--------------------------------------------------------------------------
101 | |
102 | | When utilizing the APC, database, memcached, Redis, or DynamoDB cache
103 | | stores there might be other applications using the same cache. For
104 | | that reason, you may prefix every cache key to avoid collisions.
105 | |
106 | */
107 |
108 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
109 |
110 | ];
111 |
--------------------------------------------------------------------------------
/frontend/src/components/ProfilAdmin/option/AddOptionProduct.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Ajouter Option
9 |
10 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/backend/app/Http/Controllers/category/CategoryController.php:
--------------------------------------------------------------------------------
1 | file->getClientOriginalName();
16 | $file_path = $request->file('file')->storeAs('Category', $file_name, 'public');
17 | */
18 | $categoery=new Category();
19 | $categoery->name=$request->name;
20 | $categoery->PhtotoCatg=$request->file;
21 | $categoery->save();
22 |
23 | if(count($request->option)!=0) {
24 | for($i=0;$ioption);$i++){
25 | $option=new Option();
26 | $option->nameOption=$request->option[$i]['name'];
27 | $option->category_id=$categoery->id;
28 | $option->save();
29 | }
30 | }
31 |
32 | return response()->json(['data'=>$option],200);
33 | }
34 |
35 | public function AllTypeCategorie(){
36 | $category=Category::all('name','id');
37 | return response()->json($category,200);
38 | }
39 |
40 | public function CountCategory(){
41 | $count=Category::count();
42 | return response()->json($count,200);
43 | }
44 |
45 | public function getAllCategorie(){
46 | $category=Category::All();
47 | return response()->json([$category],200);
48 | }
49 |
50 | public function GetOptionForCategorie(Request $request){
51 | if(isset($request->search)){
52 | $category=Category::with("options")->where('name','like','%'.$request->search.'%')->paginate(2);
53 | }else{
54 | $category=Category::with("options")->paginate(2);
55 | }
56 | return response()->json([$category],200);
57 | }
58 |
59 | public function deleteCategory($id){
60 | $category=Category::find($id);
61 | if($category){
62 | $category->delete();
63 | return response()->json(['message'=>"delete success"],200);
64 | }else{
65 | return response()->json(['message'=>"Not Found"],404);
66 | }
67 | }
68 |
69 | public function findCategoryByIid(int $id){
70 | $category=Category::find($id);
71 | if($category){
72 | return response()->json(["data"=>$category],200);
73 | }
74 | return response()->json(['message'=>'Category Not Found'],404);
75 | }
76 |
77 | public function UpdateCategory(int $id,Request $request){
78 | $category=Category::find($id);
79 | if($category){
80 | $category->update(
81 | [
82 | "name"=>$request->name,
83 | "PhtotoCatg"=>$request->file
84 | ],
85 | );
86 | return response()->json(["data"=>$request->file],200);
87 | }else{
88 | return response()->json(['message'=>'Category Not Found'],404);
89 | }
90 | }
91 |
92 | public function exist_name($name){
93 | $categoery=Category::where('name',$name)->first();
94 | if($categoery){
95 | return response()->json([
96 | 'success' => false,
97 | 'message' => 'name already exists',
98 | 'data' => []
99 | ], 201);
100 | } else {
101 | return response()->json([
102 | 'success' => true,
103 | 'message' => 'name not exists',
104 | 'data' => []
105 | ]);
106 | }
107 | }
108 |
109 | }
110 |
--------------------------------------------------------------------------------
/backend/config/mail.php:
--------------------------------------------------------------------------------
1 | env('MAIL_MAILER', 'smtp'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Mailer Configurations
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure all of the mailers used by your application plus
24 | | their respective settings. Several examples have been configured for
25 | | you and you are free to add your own as your application requires.
26 | |
27 | | Laravel supports a variety of mail "transport" drivers to be used while
28 | | sending an e-mail. You will specify which one you are using for your
29 | | mailers below. You are free to add additional mailers as required.
30 | |
31 | | Supported: "smtp", "sendmail", "mailgun", "ses",
32 | | "postmark", "log", "array", "failover"
33 | |
34 | */
35 |
36 | 'mailers' => [
37 | 'smtp' => [
38 | 'transport' => 'smtp',
39 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
40 | 'port' => env('MAIL_PORT', 587),
41 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
42 | 'username' => env('MAIL_USERNAME'),
43 | 'password' => env('MAIL_PASSWORD'),
44 | 'timeout' => null,
45 | 'local_domain' => env('MAIL_EHLO_DOMAIN'),
46 | ],
47 |
48 | 'ses' => [
49 | 'transport' => 'ses',
50 | ],
51 |
52 | 'mailgun' => [
53 | 'transport' => 'mailgun',
54 | ],
55 |
56 | 'postmark' => [
57 | 'transport' => 'postmark',
58 | ],
59 |
60 | 'sendmail' => [
61 | 'transport' => 'sendmail',
62 | 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
63 | ],
64 |
65 | 'log' => [
66 | 'transport' => 'log',
67 | 'channel' => env('MAIL_LOG_CHANNEL'),
68 | ],
69 |
70 | 'array' => [
71 | 'transport' => 'array',
72 | ],
73 |
74 | 'failover' => [
75 | 'transport' => 'failover',
76 | 'mailers' => [
77 | 'smtp',
78 | 'log',
79 | ],
80 | ],
81 | ],
82 |
83 | /*
84 | |--------------------------------------------------------------------------
85 | | Global "From" Address
86 | |--------------------------------------------------------------------------
87 | |
88 | | You may wish for all e-mails sent by your application to be sent from
89 | | the same address. Here, you may specify a name and address that is
90 | | used globally for all e-mails that are sent by your application.
91 | |
92 | */
93 |
94 | 'from' => [
95 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
96 | 'name' => env('MAIL_FROM_NAME', 'Example'),
97 | ],
98 |
99 | /*
100 | |--------------------------------------------------------------------------
101 | | Markdown Mail Settings
102 | |--------------------------------------------------------------------------
103 | |
104 | | If you are using Markdown based email rendering, you may configure your
105 | | theme and component paths here, allowing you to customize the design
106 | | of the emails. Or, you may simply stick with the Laravel defaults!
107 | |
108 | */
109 |
110 | 'markdown' => [
111 | 'theme' => 'default',
112 |
113 | 'paths' => [
114 | resource_path('views/vendor/mail'),
115 | ],
116 | ],
117 |
118 | ];
119 |
--------------------------------------------------------------------------------
/backend/config/auth.php:
--------------------------------------------------------------------------------
1 | [
17 | 'guard' => 'web',
18 | 'passwords' => 'users',
19 | ],
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Authentication Guards
24 | |--------------------------------------------------------------------------
25 | |
26 | | Next, you may define every authentication guard for your application.
27 | | Of course, a great default configuration has been defined for you
28 | | here which uses session storage and the Eloquent user provider.
29 | |
30 | | All authentication drivers have a user provider. This defines how the
31 | | users are actually retrieved out of your database or other storage
32 | | mechanisms used by this application to persist your user's data.
33 | |
34 | | Supported: "session"
35 | |
36 | */
37 |
38 | 'guards' => [
39 | 'web' => [
40 | 'driver' => 'session',
41 | 'provider' => 'users',
42 | ],
43 | ],
44 |
45 | /*
46 | |--------------------------------------------------------------------------
47 | | User Providers
48 | |--------------------------------------------------------------------------
49 | |
50 | | All authentication drivers have a user provider. This defines how the
51 | | users are actually retrieved out of your database or other storage
52 | | mechanisms used by this application to persist your user's data.
53 | |
54 | | If you have multiple user tables or models you may configure multiple
55 | | sources which represent each model / table. These sources may then
56 | | be assigned to any extra authentication guards you have defined.
57 | |
58 | | Supported: "database", "eloquent"
59 | |
60 | */
61 |
62 | 'providers' => [
63 | 'users' => [
64 | 'driver' => 'eloquent',
65 | 'model' => App\Models\User::class,
66 | ],
67 |
68 | // 'users' => [
69 | // 'driver' => 'database',
70 | // 'table' => 'users',
71 | // ],
72 | ],
73 |
74 | /*
75 | |--------------------------------------------------------------------------
76 | | Resetting Passwords
77 | |--------------------------------------------------------------------------
78 | |
79 | | You may specify multiple password reset configurations if you have more
80 | | than one user table or model in the application and you want to have
81 | | separate password reset settings based on the specific user types.
82 | |
83 | | The expire time is the number of minutes that each reset token will be
84 | | considered valid. This security feature keeps tokens short-lived so
85 | | they have less time to be guessed. You may change this as needed.
86 | |
87 | */
88 |
89 | 'passwords' => [
90 | 'users' => [
91 | 'provider' => 'users',
92 | 'table' => 'password_resets',
93 | 'expire' => 60,
94 | 'throttle' => 60,
95 | ],
96 | ],
97 |
98 | /*
99 | |--------------------------------------------------------------------------
100 | | Password Confirmation Timeout
101 | |--------------------------------------------------------------------------
102 | |
103 | | Here you may define the amount of seconds before a password confirmation
104 | | times out and the user is prompted to re-enter their password via the
105 | | confirmation screen. By default, the timeout lasts for three hours.
106 | |
107 | */
108 |
109 | 'password_timeout' => 10800,
110 |
111 | ];
112 |
--------------------------------------------------------------------------------
/backend/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | ## About Laravel
11 |
12 | Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
13 |
14 | - [Simple, fast routing engine](https://laravel.com/docs/routing).
15 | - [Powerful dependency injection container](https://laravel.com/docs/container).
16 | - Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
17 | - Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
18 | - Database agnostic [schema migrations](https://laravel.com/docs/migrations).
19 | - [Robust background job processing](https://laravel.com/docs/queues).
20 | - [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
21 |
22 | Laravel is accessible, powerful, and provides tools required for large, robust applications.
23 |
24 | ## Learning Laravel
25 |
26 | Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
27 |
28 | You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
29 |
30 | If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 2000 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
31 |
32 | ## Laravel Sponsors
33 |
34 | We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell).
35 |
36 | ### Premium Partners
37 |
38 | - **[Vehikl](https://vehikl.com/)**
39 | - **[Tighten Co.](https://tighten.co)**
40 | - **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
41 | - **[64 Robots](https://64robots.com)**
42 | - **[Cubet Techno Labs](https://cubettech.com)**
43 | - **[Cyber-Duck](https://cyber-duck.co.uk)**
44 | - **[Many](https://www.many.co.uk)**
45 | - **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
46 | - **[DevSquad](https://devsquad.com)**
47 | - **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
48 | - **[OP.GG](https://op.gg)**
49 | - **[WebReinvent](https://webreinvent.com/?utm_source=laravel&utm_medium=github&utm_campaign=patreon-sponsors)**
50 | - **[Lendio](https://lendio.com)**
51 |
52 | ## Contributing
53 |
54 | Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
55 |
56 | ## Code of Conduct
57 |
58 | In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
59 |
60 | ## Security Vulnerabilities
61 |
62 | If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
63 |
64 | ## License
65 |
66 | The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
67 |
--------------------------------------------------------------------------------
/backend/config/logging.php:
--------------------------------------------------------------------------------
1 | env('LOG_CHANNEL', 'stack'),
21 |
22 | /*
23 | |--------------------------------------------------------------------------
24 | | Deprecations Log Channel
25 | |--------------------------------------------------------------------------
26 | |
27 | | This option controls the log channel that should be used to log warnings
28 | | regarding deprecated PHP and library features. This allows you to get
29 | | your application ready for upcoming major versions of dependencies.
30 | |
31 | */
32 |
33 | 'deprecations' => [
34 | 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
35 | 'trace' => false,
36 | ],
37 |
38 | /*
39 | |--------------------------------------------------------------------------
40 | | Log Channels
41 | |--------------------------------------------------------------------------
42 | |
43 | | Here you may configure the log channels for your application. Out of
44 | | the box, Laravel uses the Monolog PHP logging library. This gives
45 | | you a variety of powerful log handlers / formatters to utilize.
46 | |
47 | | Available Drivers: "single", "daily", "slack", "syslog",
48 | | "errorlog", "monolog",
49 | | "custom", "stack"
50 | |
51 | */
52 |
53 | 'channels' => [
54 | 'stack' => [
55 | 'driver' => 'stack',
56 | 'channels' => ['single'],
57 | 'ignore_exceptions' => false,
58 | ],
59 |
60 | 'single' => [
61 | 'driver' => 'single',
62 | 'path' => storage_path('logs/laravel.log'),
63 | 'level' => env('LOG_LEVEL', 'debug'),
64 | ],
65 |
66 | 'daily' => [
67 | 'driver' => 'daily',
68 | 'path' => storage_path('logs/laravel.log'),
69 | 'level' => env('LOG_LEVEL', 'debug'),
70 | 'days' => 14,
71 | ],
72 |
73 | 'slack' => [
74 | 'driver' => 'slack',
75 | 'url' => env('LOG_SLACK_WEBHOOK_URL'),
76 | 'username' => 'Laravel Log',
77 | 'emoji' => ':boom:',
78 | 'level' => env('LOG_LEVEL', 'critical'),
79 | ],
80 |
81 | 'papertrail' => [
82 | 'driver' => 'monolog',
83 | 'level' => env('LOG_LEVEL', 'debug'),
84 | 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
85 | 'handler_with' => [
86 | 'host' => env('PAPERTRAIL_URL'),
87 | 'port' => env('PAPERTRAIL_PORT'),
88 | 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
89 | ],
90 | ],
91 |
92 | 'stderr' => [
93 | 'driver' => 'monolog',
94 | 'level' => env('LOG_LEVEL', 'debug'),
95 | 'handler' => StreamHandler::class,
96 | 'formatter' => env('LOG_STDERR_FORMATTER'),
97 | 'with' => [
98 | 'stream' => 'php://stderr',
99 | ],
100 | ],
101 |
102 | 'syslog' => [
103 | 'driver' => 'syslog',
104 | 'level' => env('LOG_LEVEL', 'debug'),
105 | ],
106 |
107 | 'errorlog' => [
108 | 'driver' => 'errorlog',
109 | 'level' => env('LOG_LEVEL', 'debug'),
110 | ],
111 |
112 | 'null' => [
113 | 'driver' => 'monolog',
114 | 'handler' => NullHandler::class,
115 | ],
116 |
117 | 'emergency' => [
118 | 'path' => storage_path('logs/laravel.log'),
119 | ],
120 | ],
121 |
122 | ];
123 |
--------------------------------------------------------------------------------
/frontend/src/views/ProfilAdmin/Client/ConsulteClientView.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
15 |
16 |
17 |
21 |
22 |
29 | mdi-delete
30 |
31 |
32 |
33 |
34 | Supprimer Client
38 |
39 | Voulez-vous supprimer {{ item['name'] }}
40 |
41 |
42 | Fermer
46 | Supprimer
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
62 | List Client
63 |
68 |
75 |
76 |
77 |
82 |
83 |
84 |
85 |
86 |
89 | Supprimer avec succès
90 |
91 |
97 | Fermer
98 |
99 |
100 |
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/frontend/src/views/ProfilAdmin/dashboard/SatistiqueView.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
11 |
12 |
15 | mdi-{{item.icon}}
16 |
17 |
18 |
19 | {{item.name}}
20 |
21 | {{nbrcategory}}
22 | {{countuser}}
23 | {{countProduct}}
24 | {{countoption}}
25 | {{CountOptionSpecifique}}
26 | {{countcommande}}
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
40 |
49 |
50 |
51 |
52 |
53 |
54 |
137 |
138 |
--------------------------------------------------------------------------------
/backend/config/websockets.php:
--------------------------------------------------------------------------------
1 | [
11 | 'port' => env('LARAVEL_WEBSOCKETS_PORT', 6001),
12 | ],
13 |
14 | /*
15 | * This package comes with multi tenancy out of the box. Here you can
16 | * configure the different apps that can use the webSockets server.
17 | *
18 | * Optionally you specify capacity so you can limit the maximum
19 | * concurrent connections for a specific app.
20 | *
21 | * Optionally you can disable client events so clients cannot send
22 | * messages to each other via the webSockets.
23 | */
24 | 'apps' => [
25 | [
26 | 'id' => env('PUSHER_APP_ID'),
27 | 'name' => env('APP_NAME'),
28 | 'key' => env('PUSHER_APP_KEY'),
29 | 'secret' => env('PUSHER_APP_SECRET'),
30 | 'path' => env('PUSHER_APP_PATH'),
31 | 'capacity' => null,
32 | 'enable_client_messages' => false,
33 | 'enable_statistics' => true,
34 | ],
35 | ],
36 |
37 | /*
38 | * This class is responsible for finding the apps. The default provider
39 | * will use the apps defined in this config file.
40 | *
41 | * You can create a custom provider by implementing the
42 | * `AppProvider` interface.
43 | */
44 | 'app_provider' => BeyondCode\LaravelWebSockets\Apps\ConfigAppProvider::class,
45 |
46 | /*
47 | * This array contains the hosts of which you want to allow incoming requests.
48 | * Leave this empty if you want to accept requests from all hosts.
49 | */
50 | 'allowed_origins' => [
51 | //
52 | ],
53 |
54 | /*
55 | * The maximum request size in kilobytes that is allowed for an incoming WebSocket request.
56 | */
57 | 'max_request_size_in_kb' => 250,
58 |
59 | /*
60 | * This path will be used to register the necessary routes for the package.
61 | */
62 | 'path' => 'laravel-websockets',
63 |
64 | /*
65 | * Dashboard Routes Middleware
66 | *
67 | * These middleware will be assigned to every dashboard route, giving you
68 | * the chance to add your own middleware to this list or change any of
69 | * the existing middleware. Or, you can simply stick with this list.
70 | */
71 | 'middleware' => [
72 | 'web',
73 | Authorize::class,
74 | ],
75 |
76 | 'statistics' => [
77 | /*
78 | * This model will be used to store the statistics of the WebSocketsServer.
79 | * The only requirement is that the model should extend
80 | * `WebSocketsStatisticsEntry` provided by this package.
81 | */
82 | 'model' => \BeyondCode\LaravelWebSockets\Statistics\Models\WebSocketsStatisticsEntry::class,
83 |
84 | /**
85 | * The Statistics Logger will, by default, handle the incoming statistics, store them
86 | * and then release them into the database on each interval defined below.
87 | */
88 | 'logger' => BeyondCode\LaravelWebSockets\Statistics\Logger\HttpStatisticsLogger::class,
89 |
90 | /*
91 | * Here you can specify the interval in seconds at which statistics should be logged.
92 | */
93 | 'interval_in_seconds' => 60,
94 |
95 | /*
96 | * When the clean-command is executed, all recorded statistics older than
97 | * the number of days specified here will be deleted.
98 | */
99 | 'delete_statistics_older_than_days' => 60,
100 |
101 | /*
102 | * Use an DNS resolver to make the requests to the statistics logger
103 | * default is to resolve everything to 127.0.0.1.
104 | */
105 | 'perform_dns_lookup' => false,
106 | ],
107 |
108 | /*
109 | * Define the optional SSL context for your WebSocket connections.
110 | * You can see all available options at: http://php.net/manual/en/context.ssl.php
111 | */
112 | 'ssl' => [
113 | /*
114 | * Path to local certificate file on filesystem. It must be a PEM encoded file which
115 | * contains your certificate and private key. It can optionally contain the
116 | * certificate chain of issuers. The private key also may be contained
117 | * in a separate file specified by local_pk.
118 | */
119 | 'local_cert' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT', null),
120 |
121 | /*
122 | * Path to local private key file on filesystem in case of separate files for
123 | * certificate (local_cert) and private key.
124 | */
125 | 'local_pk' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_PK', null),
126 |
127 | /*
128 | * Passphrase for your local_cert file.
129 | */
130 | 'passphrase' => env('LARAVEL_WEBSOCKETS_SSL_PASSPHRASE', null),
131 | ],
132 |
133 | /*
134 | * Channel Manager
135 | * This class handles how channel persistence is handled.
136 | * By default, persistence is stored in an array by the running webserver.
137 | * The only requirement is that the class should implement
138 | * `ChannelManager` interface provided by this package.
139 | */
140 | 'channel_manager' => \BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManagers\ArrayChannelManager::class,
141 | ];
142 |
--------------------------------------------------------------------------------
/frontend/src/components/ProfilAdmin/category/UpdateCategory.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
Modifier Categorie
8 |
9 |
10 |
11 |
12 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/backend/app/Http/Controllers/Option/OptionController.php:
--------------------------------------------------------------------------------
1 | nameOption=$request->nameOption;
20 | $option->category_id=$request->id;
21 | $option->save();
22 | return response()->json($option,200);
23 | }
24 |
25 | public function addOptionSpecifique(StoreOptionSupp $request){
26 | $option=new OptionSpecifique();
27 | $option->nameOptionSpecifique=$request->name;
28 | $option->prixOptionSpecifique=$request->prix;
29 | $option->product_id=$request->id;
30 | $option->save();
31 | return response()->json($option,200);
32 | }
33 |
34 | public function getOptionSpecifique(Request $request){
35 | if($request->id==-1 && isset($request->search)){
36 | $option=OptionSpecifique::where('nameOptionSpecifique','like','%'.$request->search.'%')->paginate(3);
37 | }else if($request->id!=-1 && !isset($request->search)){
38 | $option=OptionSpecifique::where('product_id','=',$request->id)->paginate(3);
39 | }else if($request->id==-1 && !isset($request->search)){
40 | $option=OptionSpecifique::paginate(3);
41 | }else if($request->id!=-1 && isset($request->search)){
42 | $option=OptionSpecifique::where('nameOptionSpecifique','like','%'.$request->search.'%')->
43 | where('product_id','=',$request->id)->paginate(3);
44 | }
45 | return response()->json($option,200);
46 | }
47 |
48 | public function getOptionGlobal(Request $request){
49 | if($request->id==-1 && isset($request->search)){
50 | $option=Option::where('nameOption','like','%'.$request->search.'%')->paginate(3);
51 | }else if($request->id!=-1 && !isset($request->search)){
52 | $option=Option::where('category_id','=',$request->id)->paginate(3);
53 | }else if($request->id==-1 && !isset($request->search)){
54 | $option=Option::paginate(3);
55 | }else if($request->id!=-1 && isset($request->search)){
56 | $option=Option::where('nameOption','like','%'.$request->search.'%')->
57 | where('category_id','=',$request->id)->paginate(3);
58 | }
59 | return response()->json($option,200);
60 | }
61 |
62 | public function findOptionByIid(int $id){
63 | $option=Category::find($id);
64 | if($option){
65 | return response()->json(["data"=>$option],200);
66 | }
67 | return response()->json(['message'=>'option Not Found'],404);
68 | }
69 |
70 | public function getOptionByIdCategory($id){
71 | //$category=Category::with("options")->where('name','like','%'.$request->search.'%')->get();
72 | $category=Category::with("options")->where('id',$id)->get();
73 | if($category){
74 | return response()->json(["data"=>$category[0]['options']],200);
75 | }else{
76 | return response()->json(["data"=>"Not Found"],404);
77 | }
78 |
79 | }
80 |
81 | public function deleteOption($id){
82 | $option=Option::find($id);
83 | if($option){
84 | $option->delete();
85 | return response()->json(['message'=>"delete success"],200);
86 | }else{
87 | return response()->json(['message'=>"Not Found"],404);
88 | }
89 | }
90 |
91 | public function deleteOptionSpecifique($id){
92 | $option=OptionSpecifique::find($id);
93 | if($option){
94 | $option->delete();
95 | return response()->json(['message'=>"delete success"],200);
96 | }else{
97 | return response()->json(['message'=>"Not Found"],404);
98 | }
99 | }
100 |
101 | public function UpdateOption(Request $request,int $id){
102 | $option=Option::find($id);
103 | if($option){
104 | $option->update(
105 | [
106 | "nameOption"=>$request->name,
107 | ],
108 | );
109 | return response()->json(["data"=>$option],200);
110 | }else{
111 | return response()->json(['message'=>'Option Not Found'],404);
112 | }
113 | }
114 |
115 | public function UpdateOptionSpecifique(Request $request,int $id){
116 | $option=OptionSpecifique::find($id);
117 | if($option){
118 | $option->update(
119 | [
120 | "nameOptionSpecifique"=>$request->name,
121 | "prixOptionSpecifique"=>$request->prix
122 | ],
123 | );
124 | return response()->json(["data"=>$option],200);
125 | }else{
126 | return response()->json(['message'=>'Option Not Found'],404);
127 | }
128 | }
129 |
130 | public function CountOption(){
131 | $Option=Option::count();
132 | return response()->json(['data'=>$Option],200);
133 | }
134 |
135 | public function CountOptionSpecifique(){
136 | $Option=OptionSpecifique::count();
137 | return response()->json(['data'=>$Option],200);
138 | }
139 |
140 | public function getAlloption(){
141 | $option=ligneCommandeOption::all();
142 | return response()->json($option,200);
143 | }
144 |
145 |
146 | }
147 |
--------------------------------------------------------------------------------
/backend/config/database.php:
--------------------------------------------------------------------------------
1 | env('DB_CONNECTION', 'mysql'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Database Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here are each of the database connections setup for your application.
26 | | Of course, examples of configuring each database platform that is
27 | | supported by Laravel is shown below to make development simple.
28 | |
29 | |
30 | | All database work in Laravel is done through the PHP PDO facilities
31 | | so make sure you have the driver for your particular database of
32 | | choice installed on your machine before you begin development.
33 | |
34 | */
35 |
36 | 'connections' => [
37 |
38 | 'sqlite' => [
39 | 'driver' => 'sqlite',
40 | 'url' => env('DATABASE_URL'),
41 | 'database' => env('DB_DATABASE', database_path('database.sqlite')),
42 | 'prefix' => '',
43 | 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
44 | ],
45 |
46 | 'mysql' => [
47 | 'driver' => 'mysql',
48 | 'url' => env('DATABASE_URL'),
49 | 'host' => env('DB_HOST', '127.0.0.1'),
50 | 'port' => env('DB_PORT', '3306'),
51 | 'database' => env('DB_DATABASE', 'forge'),
52 | 'username' => env('DB_USERNAME', 'forge'),
53 | 'password' => env('DB_PASSWORD', ''),
54 | 'unix_socket' => env('DB_SOCKET', ''),
55 | 'charset' => 'utf8mb4',
56 | 'collation' => 'utf8mb4_unicode_ci',
57 | 'prefix' => '',
58 | 'prefix_indexes' => true,
59 | 'strict' => true,
60 | 'engine' => null,
61 | 'options' => extension_loaded('pdo_mysql') ? array_filter([
62 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
63 | ]) : [],
64 | ],
65 |
66 | 'pgsql' => [
67 | 'driver' => 'pgsql',
68 | 'url' => env('DATABASE_URL'),
69 | 'host' => env('DB_HOST', '127.0.0.1'),
70 | 'port' => env('DB_PORT', '5432'),
71 | 'database' => env('DB_DATABASE', 'forge'),
72 | 'username' => env('DB_USERNAME', 'forge'),
73 | 'password' => env('DB_PASSWORD', ''),
74 | 'charset' => 'utf8',
75 | 'prefix' => '',
76 | 'prefix_indexes' => true,
77 | 'search_path' => 'public',
78 | 'sslmode' => 'prefer',
79 | ],
80 |
81 | 'sqlsrv' => [
82 | 'driver' => 'sqlsrv',
83 | 'url' => env('DATABASE_URL'),
84 | 'host' => env('DB_HOST', 'localhost'),
85 | 'port' => env('DB_PORT', '1433'),
86 | 'database' => env('DB_DATABASE', 'forge'),
87 | 'username' => env('DB_USERNAME', 'forge'),
88 | 'password' => env('DB_PASSWORD', ''),
89 | 'charset' => 'utf8',
90 | 'prefix' => '',
91 | 'prefix_indexes' => true,
92 | // 'encrypt' => env('DB_ENCRYPT', 'yes'),
93 | // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
94 | ],
95 |
96 | ],
97 |
98 | /*
99 | |--------------------------------------------------------------------------
100 | | Migration Repository Table
101 | |--------------------------------------------------------------------------
102 | |
103 | | This table keeps track of all the migrations that have already run for
104 | | your application. Using this information, we can determine which of
105 | | the migrations on disk haven't actually been run in the database.
106 | |
107 | */
108 |
109 | 'migrations' => 'migrations',
110 |
111 | /*
112 | |--------------------------------------------------------------------------
113 | | Redis Databases
114 | |--------------------------------------------------------------------------
115 | |
116 | | Redis is an open source, fast, and advanced key-value store that also
117 | | provides a richer body of commands than a typical key-value system
118 | | such as APC or Memcached. Laravel makes it easy to dig right in.
119 | |
120 | */
121 |
122 | 'redis' => [
123 |
124 | 'client' => env('REDIS_CLIENT', 'phpredis'),
125 |
126 | 'options' => [
127 | 'cluster' => env('REDIS_CLUSTER', 'redis'),
128 | 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
129 | ],
130 |
131 | 'default' => [
132 | 'url' => env('REDIS_URL'),
133 | 'host' => env('REDIS_HOST', '127.0.0.1'),
134 | 'username' => env('REDIS_USERNAME'),
135 | 'password' => env('REDIS_PASSWORD'),
136 | 'port' => env('REDIS_PORT', '6379'),
137 | 'database' => env('REDIS_DB', '0'),
138 | ],
139 |
140 | 'cache' => [
141 | 'url' => env('REDIS_URL'),
142 | 'host' => env('REDIS_HOST', '127.0.0.1'),
143 | 'username' => env('REDIS_USERNAME'),
144 | 'password' => env('REDIS_PASSWORD'),
145 | 'port' => env('REDIS_PORT', '6379'),
146 | 'database' => env('REDIS_CACHE_DB', '1'),
147 | ],
148 |
149 | ],
150 |
151 | ];
152 |
--------------------------------------------------------------------------------