News-Portal-FedLearntRecommender

所属分类:推荐系统
开发工具:PHP
文件大小:0KB
下载次数:0
上传日期:2023-08-11 11:44:13
上 传 者sh-1993
说明:  新闻门户FedLearnt推荐人,,
(News-Portal-FedLearntRecommender,,)

文件列表:
.DS_Store (10244, 2023-08-11)
.editorconfig (220, 2023-08-11)
.env.example (806, 2023-08-11)
.styleci.yml (181, 2023-08-11)
LICENSE (35149, 2023-08-11)
api/ (0, 2023-08-11)
api/index.php (50, 2023-08-11)
app/ (0, 2023-08-11)
app/Actions/ (0, 2023-08-11)
app/Actions/Fortify/ (0, 2023-08-11)
app/Actions/Fortify/CreateNewUser.php (1016, 2023-08-11)
app/Actions/Fortify/PasswordValidationRules.php (331, 2023-08-11)
app/Actions/Fortify/ResetUserPassword.php (693, 2023-08-11)
app/Actions/Fortify/UpdateUserPassword.php (1053, 2023-08-11)
app/Actions/Fortify/UpdateUserProfileInformation.php (1904, 2023-08-11)
app/Actions/Jetstream/ (0, 2023-08-11)
app/Actions/Jetstream/DeleteUser.php (381, 2023-08-11)
app/Console/ (0, 2023-08-11)
app/Console/Kernel.php (827, 2023-08-11)
app/Exceptions/ (0, 2023-08-11)
app/Exceptions/Handler.php (670, 2023-08-11)
app/Http/ (0, 2023-08-11)
app/Http/Controllers/ (0, 2023-08-11)
app/Http/Controllers/Api/ (0, 2023-08-11)
app/Http/Controllers/Api/CategoryApiController.php (890, 2023-08-11)
app/Http/Controllers/Api/CommentApiController.php (694, 2023-08-11)
app/Http/Controllers/Api/PostApiController.php (1181, 2023-08-11)
app/Http/Controllers/Api/TagApiController.php (501, 2023-08-11)
app/Http/Controllers/Api/UserApiController.php (5344, 2023-08-11)
app/Http/Controllers/Controller.php (361, 2023-08-11)
app/Http/Controllers/GenerateCSVController.php (4309, 2023-08-11)
app/Http/Controllers/LikeUnlikeController.php (2479, 2023-08-11)
app/Http/Controllers/NewsViewController.php (2561, 2023-08-11)
app/Http/Controllers/PythonModelController.php (2185, 2023-08-11)
app/Http/Controllers/RoleAssignController.php (4272, 2023-08-11)
app/Http/Controllers/RolesController.php (6141, 2023-08-11)
app/Http/Controllers/auth/ (0, 2023-08-11)
... ...

# Laravel News API with Admin Panel Laravel 8 Admin Panel with API using Jetstream, Livewire, Sanctum, and Tailwind. 1. `git clone ` 2. `cd newsportal` 3. `composer install` 4. `cp .env.example .env` 5. `php artisan key:generate` 6. Set your database credentials in `.env` file 7. `php artisan migrate:fresh --seed` 8. `php artisan storage:link` 9. `npm install && npm run dev` 10. `php artisan serve` 11. Visit `localhost:8000/login` in your browser 12. Choose one `email` id from `users` table. Password is `password`. ### Screenshots Response from API to be consumed by mobile apps etc. ![api response](https://miro.medium.com/max/3000/1*yttnGhlogAK_ZtY4sBUqMQ.png "API Response") Admin Dashboard - Category Managment Page ![category managment page](https://miro.medium.com/max/875/1*stzLGcvrR15TmokZZIrsRQ.png "Category Managment Page") Admin Dashboard - Create Category ![create category](https://miro.medium.com/max/875/1*dOZ1DSehN-5SYbv9_aSh_Q.png "Create Category") Admin Dashboard - Edit Category ![edit category](https://miro.medium.com/max/875/1*iWv3ujBXhOpIJV-NiOA-gg.png "Edit Category") Admin Dashboard - Post Managment Page ![post managment page](https://miro.medium.com/max/678/1*4pUX8N43eYjdmenGyFJ3nA.png "Post Management Page") Admin Dashboard - Create Post ![create post](https://miro.medium.com/max/875/1*IDLWBhGNB3KHEiYi6N1czA.png "Create Post") Admin Dashboard - Edit Post ![edit post](https://miro.medium.com/max/875/1*5SBQT9TRSL140saVh1Hl7Q.png "Edit Post") DigitalOcean Referral Badge ### How to host Laravel Project on DO Thanks to [Nathan Mwamba Musonda](https://www.facebook.com/nathan.mwamba.9638) for contributing steps to follw: [Google Doc Link](https://drive.google.com/file/d/1xzfwTVkJ0c6VhMSYqO8Q1Oh95KctCwse/view?fbclid=IwAR09pKJKwLaEkHCKs8scx-W-_Wmje7Th4I4Ff6ae0MdXICPMM7EGKAauPjM) So here is the clue on how you can host a laravel project on digital ocean using database and spaces as your file storage. you can do this by creating an APP, DATABASE and SPACE without using a droplet. // install laravel on you computer ``` $ composer create-project --prefer-dist laravel/laravel:^7.0 project ``` // create the migrations ``` php artisan make:model Image -m ``` //make tables ``` Schema::create('advances', function (Blueprint $table) { $table->id(); $table->string('image')->nullable(); $table->longText('image_name')->nullable(); $table->timestamps(); }); ``` //migrate the tables ``` php artisan migrate ``` //Create a view (resources/views/image/upload.blade.php) ```
Information
@csrf
``` //create controller ``` php artisan make:controller ImageController ``` //setup the controller ``` $images, ]); } public function create() { return view('image.upload', [ ]); } public function store(Request $request) { $image = new Image(); $image->image_name = $request->image_name; if ($request-> hasfile('image')){ $filenamewithext = $request->file('image')->getClientOriginalName(); $filename = pathinfo($filenamewithext,PATHINFO_FILENAME); $extension = $request->file('image')->getClientOriginalExtension(); $filenametostore = '1_'.$filename.'_'.time().'.'.$extension; $image->image = $request->image->store('/beats', 'spaces', $filenametostore); } $image->save(); return redirect()->back(); } } ``` //setup the route ``` Route::get('/', 'ImageController@index'); Route::get('/upload', 'ImageController@create'); Route::post('/image/upload', 'ImageController@store'); ``` //setup the filesystem Driver for digital ocean spaces/ In Config/Filesystem Driver ``` 'disks' => [ 'local' => [ 'driver' => 'local', 'root' => storage_path('app'), ], 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), 'url' => env('APP_URL').'/storage', 'visibility' => 'public', ], 's3' => [ 'driver' => 's3', 'key' => env('AWS_ACCESS_KEY_ID'), 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'region' => env('AWS_DEFAULT_REGION'), 'bucket' => env('AWS_BUCKET'), 'url' => env('AWS_URL'), 'endpoint' => env('AWS_ENDPOINT'), ], 'spaces' => [ 'driver' => 's3', 'key' => env('DO_SPACES_KEY'), 'secret' => env('DO_SPACES_SECRET'), 'region' => env('DO_SPACES_REGION'), 'bucket' => env('DO_SPACES_BUCKET'), 'endpoint' => env('DO_SPACES_ENDPOINT'), ], ], ``` //Returning a view (resources/views/images.blade.php) ``` @foreach ($images as $image)
@endforeach ``` //In your env include these ``` DO_SPACES_KEY=your key DO_SPACES_SECRET=your secret DO_SPACES_ENDPOINT=endpoint DO_SPACES_REGION=ams3 DO_SPACES_BUCKET=your bucket DO_URL=your url ``` // remember the variable will be provided by digital ocean when you create space

近期下载者

相关文件


收藏者