Article Save and sweet alert

This commit is contained in:
2020-08-17 03:05:09 +05:00
parent 31e2e89e9b
commit e4d01339ef
24 changed files with 126620 additions and 28 deletions

8
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

123
.idea/baraveli-news.iml generated Normal file
View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/app" isTestSource="false" packagePrefix="App\" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="Tests\" />
<sourceFolder url="file://$MODULE_DIR$/tests/Unit" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/tests/Feature" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/vendor/asm89/stack-cors" />
<excludeFolder url="file://$MODULE_DIR$/vendor/brick/math" />
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/dnoegel/php-xdg-base-dir" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/inflector" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/instantiator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/lexer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/dragonmantank/cron-expression" />
<excludeFolder url="file://$MODULE_DIR$/vendor/egulias/email-validator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/fabpot/goutte" />
<excludeFolder url="file://$MODULE_DIR$/vendor/facade/flare-client-php" />
<excludeFolder url="file://$MODULE_DIR$/vendor/facade/ignition" />
<excludeFolder url="file://$MODULE_DIR$/vendor/facade/ignition-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/fideloper/proxy" />
<excludeFolder url="file://$MODULE_DIR$/vendor/filp/whoops" />
<excludeFolder url="file://$MODULE_DIR$/vendor/fruitcake/laravel-cors" />
<excludeFolder url="file://$MODULE_DIR$/vendor/fzaninotto/faker" />
<excludeFolder url="file://$MODULE_DIR$/vendor/goldspecdigital/laravel-eloquent-uuid" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/guzzle" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/promises" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/psr7" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hamcrest/hamcrest-php" />
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/framework" />
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/tinker" />
<excludeFolder url="file://$MODULE_DIR$/vendor/league/commonmark" />
<excludeFolder url="file://$MODULE_DIR$/vendor/league/flysystem" />
<excludeFolder url="file://$MODULE_DIR$/vendor/mockery/mockery" />
<excludeFolder url="file://$MODULE_DIR$/vendor/monolog/monolog" />
<excludeFolder url="file://$MODULE_DIR$/vendor/mtownsend/read-time" />
<excludeFolder url="file://$MODULE_DIR$/vendor/myclabs/deep-copy" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nesbot/carbon" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nikic/php-parser" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nunomaduro/collision" />
<excludeFolder url="file://$MODULE_DIR$/vendor/opis/closure" />
<excludeFolder url="file://$MODULE_DIR$/vendor/paragonie/random_compat" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/manifest" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/version" />
<excludeFolder url="file://$MODULE_DIR$/vendor/php-webdriver/webdriver" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-common" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-docblock" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/type-resolver" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpoption/phpoption" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpspec/prophecy" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-code-coverage" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-file-iterator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-text-template" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-timer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-token-stream" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/phpunit" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/container" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/event-dispatcher" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-message" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/log" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/simple-cache" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psy/psysh" />
<excludeFolder url="file://$MODULE_DIR$/vendor/ralouphie/getallheaders" />
<excludeFolder url="file://$MODULE_DIR$/vendor/ramsey/collection" />
<excludeFolder url="file://$MODULE_DIR$/vendor/ramsey/uuid" />
<excludeFolder url="file://$MODULE_DIR$/vendor/scrivo/highlight.php" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/comparator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/diff" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/environment" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/exporter" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/global-state" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-enumerator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-reflector" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/recursion-context" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/resource-operations" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/type" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/version" />
<excludeFolder url="file://$MODULE_DIR$/vendor/swiftmailer/swiftmailer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/browser-kit" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/console" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/css-selector" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/deprecation-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/dom-crawler" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/error-handler" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/finder" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-client" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-client-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-foundation" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-kernel" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/mime" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/panther" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-ctype" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-iconv" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-grapheme" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-idn" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-normalizer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-mbstring" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php70" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php72" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php73" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php80" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/process" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/routing" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/service-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/string" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/var-dumper" />
<excludeFolder url="file://$MODULE_DIR$/vendor/theseer/tokenizer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/tijsverkoyen/css-to-inline-styles" />
<excludeFolder url="file://$MODULE_DIR$/vendor/vlucas/phpdotenv" />
<excludeFolder url="file://$MODULE_DIR$/vendor/voku/portable-ascii" />
<excludeFolder url="file://$MODULE_DIR$/vendor/webmozart/assert" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/laravel-plugin.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="LaravelPluginSettings">
<option name="pluginEnabled" value="true" />
</component>
</project>

6
.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>

8
.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/baraveli-news.iml" filepath="$PROJECT_DIR$/.idea/baraveli-news.iml" />
</modules>
</component>
</project>

122
.idea/php.xml generated Normal file
View File

@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PhpIncludePathManager">
<include_path>
<path value="$PROJECT_DIR$/vendor/symfony/mime" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
<path value="$PROJECT_DIR$/vendor/symfony/deprecation-contracts" />
<path value="$PROJECT_DIR$/vendor/symfony/string" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php70" />
<path value="$PROJECT_DIR$/vendor/voku/portable-ascii" />
<path value="$PROJECT_DIR$/vendor/fabpot/goutte" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php80" />
<path value="$PROJECT_DIR$/vendor/symfony/css-selector" />
<path value="$PROJECT_DIR$/vendor/symfony/var-dumper" />
<path value="$PROJECT_DIR$/vendor/symfony/error-handler" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-grapheme" />
<path value="$PROJECT_DIR$/vendor/symfony/browser-kit" />
<path value="$PROJECT_DIR$/vendor/symfony/finder" />
<path value="$PROJECT_DIR$/vendor/symfony/translation-contracts" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php72" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php73" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-normalizer" />
<path value="$PROJECT_DIR$/vendor/symfony/translation" />
<path value="$PROJECT_DIR$/vendor/symfony/dom-crawler" />
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher-contracts" />
<path value="$PROJECT_DIR$/vendor/webmozart/assert" />
<path value="$PROJECT_DIR$/vendor/facade/ignition" />
<path value="$PROJECT_DIR$/vendor/symfony/service-contracts" />
<path value="$PROJECT_DIR$/vendor/facade/ignition-contracts" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-iconv" />
<path value="$PROJECT_DIR$/vendor/facade/flare-client-php" />
<path value="$PROJECT_DIR$/vendor/symfony/http-client" />
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
<path value="$PROJECT_DIR$/vendor/symfony/http-foundation" />
<path value="$PROJECT_DIR$/vendor/symfony/process" />
<path value="$PROJECT_DIR$/vendor/symfony/panther" />
<path value="$PROJECT_DIR$/vendor/fzaninotto/faker" />
<path value="$PROJECT_DIR$/vendor/nesbot/carbon" />
<path value="$PROJECT_DIR$/vendor/monolog/monolog" />
<path value="$PROJECT_DIR$/vendor/theseer/tokenizer" />
<path value="$PROJECT_DIR$/vendor/vlucas/phpdotenv" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/promises" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/psr7" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/guzzle" />
<path value="$PROJECT_DIR$/vendor/phpdocumentor/type-resolver" />
<path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-docblock" />
<path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-common" />
<path value="$PROJECT_DIR$/vendor/psr/simple-cache" />
<path value="$PROJECT_DIR$/vendor/doctrine/inflector" />
<path value="$PROJECT_DIR$/vendor/psr/http-message" />
<path value="$PROJECT_DIR$/vendor/doctrine/instantiator" />
<path value="$PROJECT_DIR$/vendor/psr/container" />
<path value="$PROJECT_DIR$/vendor/doctrine/lexer" />
<path value="$PROJECT_DIR$/vendor/psr/event-dispatcher" />
<path value="$PROJECT_DIR$/vendor/psr/log" />
<path value="$PROJECT_DIR$/vendor/scrivo/highlight.php" />
<path value="$PROJECT_DIR$/vendor/fideloper/proxy" />
<path value="$PROJECT_DIR$/vendor/fruitcake/laravel-cors" />
<path value="$PROJECT_DIR$/vendor/phpspec/prophecy" />
<path value="$PROJECT_DIR$/vendor/dnoegel/php-xdg-base-dir" />
<path value="$PROJECT_DIR$/vendor/tijsverkoyen/css-to-inline-styles" />
<path value="$PROJECT_DIR$/vendor/egulias/email-validator" />
<path value="$PROJECT_DIR$/vendor/mtownsend/read-time" />
<path value="$PROJECT_DIR$/vendor/dragonmantank/cron-expression" />
<path value="$PROJECT_DIR$/vendor/mockery/mockery" />
<path value="$PROJECT_DIR$/vendor/php-webdriver/webdriver" />
<path value="$PROJECT_DIR$/vendor/paragonie/random_compat" />
<path value="$PROJECT_DIR$/vendor/myclabs/deep-copy" />
<path value="$PROJECT_DIR$/vendor/nunomaduro/collision" />
<path value="$PROJECT_DIR$/vendor/phpoption/phpoption" />
<path value="$PROJECT_DIR$/vendor/goldspecdigital/laravel-eloquent-uuid" />
<path value="$PROJECT_DIR$/vendor/hamcrest/hamcrest-php" />
<path value="$PROJECT_DIR$/vendor/ramsey/collection" />
<path value="$PROJECT_DIR$/vendor/ramsey/uuid" />
<path value="$PROJECT_DIR$/vendor/ralouphie/getallheaders" />
<path value="$PROJECT_DIR$/vendor/sebastian/resource-operations" />
<path value="$PROJECT_DIR$/vendor/filp/whoops" />
<path value="$PROJECT_DIR$/vendor/sebastian/recursion-context" />
<path value="$PROJECT_DIR$/vendor/laravel/framework" />
<path value="$PROJECT_DIR$/vendor/sebastian/global-state" />
<path value="$PROJECT_DIR$/vendor/laravel/tinker" />
<path value="$PROJECT_DIR$/vendor/sebastian/diff" />
<path value="$PROJECT_DIR$/vendor/sebastian/exporter" />
<path value="$PROJECT_DIR$/vendor/sebastian/object-enumerator" />
<path value="$PROJECT_DIR$/vendor/sebastian/environment" />
<path value="$PROJECT_DIR$/vendor/sebastian/comparator" />
<path value="$PROJECT_DIR$/vendor/sebastian/object-reflector" />
<path value="$PROJECT_DIR$/vendor/sebastian/version" />
<path value="$PROJECT_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
<path value="$PROJECT_DIR$/vendor/sebastian/type" />
<path value="$PROJECT_DIR$/vendor/phar-io/version" />
<path value="$PROJECT_DIR$/vendor/phar-io/manifest" />
<path value="$PROJECT_DIR$/vendor/asm89/stack-cors" />
<path value="$PROJECT_DIR$/vendor/swiftmailer/swiftmailer" />
<path value="$PROJECT_DIR$/vendor/psy/psysh" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-token-stream" />
<path value="$PROJECT_DIR$/vendor/league/flysystem" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-text-template" />
<path value="$PROJECT_DIR$/vendor/league/commonmark" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-timer" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-file-iterator" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-code-coverage" />
<path value="$PROJECT_DIR$/vendor/brick/math" />
<path value="$PROJECT_DIR$/vendor/phpunit/phpunit" />
<path value="$PROJECT_DIR$/vendor/opis/closure" />
<path value="$PROJECT_DIR$/vendor/composer" />
<path value="$PROJECT_DIR$/vendor/symfony/http-kernel" />
<path value="$PROJECT_DIR$/vendor/symfony/http-client-contracts" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-idn" />
<path value="$PROJECT_DIR$/vendor/symfony/console" />
<path value="$PROJECT_DIR$/vendor/nikic/php-parser" />
<path value="$PROJECT_DIR$/vendor/symfony/routing" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="7.2" />
<component name="PhpUnit">
<phpunit_settings>
<PhpUnitSettings configuration_file_path="$PROJECT_DIR$/phpunit.xml" custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" use_configuration_file="true" />
</phpunit_settings>
</component>
</project>

11
.idea/phpunit.xml generated Normal file
View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PHPUnit">
<option name="directories">
<list>
<option value="$PROJECT_DIR$/tests/Unit" />
<option value="$PROJECT_DIR$/tests/Feature" />
</list>
</option>
</component>
</project>

6
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@@ -0,0 +1,31 @@
<?php
namespace App\Http\Controllers;
use App\Article;
use Illuminate\Http\Request;
class MylistController extends Controller
{
public function index(Request $request)
{
return view('mylist.index', [
'articles' => $request->session()->get('mylist')
]);
}
public function store(Article $article, Request $request)
{
if (collect($request->session()->get('mylist'))->contains('id', $article->id)) {
toast('Article already saved!', 'error');
return back();
}
$request->session()->push('mylist', $article);
toast('Article Saved!', 'success');
return back();
}
}

View File

@@ -17,6 +17,7 @@
"laravel/framework": "^7.24", "laravel/framework": "^7.24",
"laravel/tinker": "^2.0", "laravel/tinker": "^2.0",
"mtownsend/read-time": "^1.1", "mtownsend/read-time": "^1.1",
"realrashid/sweet-alert": "^3.1",
"symfony/panther": "^0.7.1" "symfony/panther": "^0.7.1"
}, },
"require-dev": { "require-dev": {

68
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "41362fd417d7ab5e3fbfed6a6ad60125", "content-hash": "09685265c0b9071f94294d970cc0a014",
"packages": [ "packages": [
{ {
"name": "asm89/stack-cors", "name": "asm89/stack-cors",
@@ -2181,6 +2181,72 @@
], ],
"time": "2020-07-28T16:51:01+00:00" "time": "2020-07-28T16:51:01+00:00"
}, },
{
"name": "realrashid/sweet-alert",
"version": "v3.1.6",
"source": {
"type": "git",
"url": "https://github.com/realrashid/sweet-alert.git",
"reference": "7253f8f1b9c7c26ee70d6b7ae641637317e291ee"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/realrashid/sweet-alert/zipball/7253f8f1b9c7c26ee70d6b7ae641637317e291ee",
"reference": "7253f8f1b9c7c26ee70d6b7ae641637317e291ee",
"shasum": ""
},
"require": {
"laravel/framework": "^5.4|^6.0|^7.0",
"php": "^7.2"
},
"require-dev": {
"symfony/thanks": "^1.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"RealRashid\\SweetAlert\\SweetAlertServiceProvider"
],
"aliases": {
"Alert": "RealRashid\\SweetAlert\\Facades\\Alert"
}
}
},
"autoload": {
"psr-4": {
"RealRashid\\SweetAlert\\": "src/"
},
"files": [
"src/functions.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Rashid Ali",
"email": "realrashid05@gmail.com",
"homepage": "https://realrashid.com",
"role": "Developer"
}
],
"description": "A BEAUTIFUL, RESPONSIVE, CUSTOMIZABLE, ACCESSIBLE (WAI-ARIA) REPLACEMENT FOR JAVASCRIPT'S POPUP BOXES FOR LARAVEL BY RASHID ALI",
"homepage": "https://github.com/realrashid/sweet-alert",
"keywords": [
"alert",
"laravel",
"laravel-package",
"notifier",
"noty",
"sweet-alert",
"sweet-alert2",
"toast"
],
"time": "2020-07-17T18:23:42+00:00"
},
{ {
"name": "swiftmailer/swiftmailer", "name": "swiftmailer/swiftmailer",
"version": "v6.2.3", "version": "v6.2.3",

201
config/sweetalert.php Normal file
View File

@@ -0,0 +1,201 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| CDN LINK
|--------------------------------------------------------------------------
| By default SweetAlert2 use its local sweetalert.all.js
| file.
| However, you can use its cdn if you want.
|
*/
'cdn' => env('SWEET_ALERT_CDN'),
/*
|--------------------------------------------------------------------------
| Always load the sweetalert.all.js
|--------------------------------------------------------------------------
| There might be situations where you will always want the sweet alert
| js package to be there for you. (for eg. you might use it heavily to
| show notifications or you might want to use the native js) then this
| might be handy.
|
*/
'alwaysLoadJS' => env('SWEET_ALERT_ALWAYS_LOAD_JS', false),
/*
|--------------------------------------------------------------------------
| Never load the sweetalert.all.js
|--------------------------------------------------------------------------
| If you want to handle the sweet alert js package by yourself
| (for eg. you might want to use laravel mix) then this can be
| handy.
| If you set always load js to true & never load js to false,
| it's going to prioritize the never load js.
|
| alwaysLoadJs = true & neverLoadJs = true => js will not be loaded
| alwaysLoadJs = true & neverLoadJs = false => js will be loaded
| alwaysLoadJs = false & neverLoadJs = false => js will be loaded when
| you set alert/toast by using the facade/helper functions.
*/
'neverLoadJS' => env('SWEET_ALERT_NEVER_LOAD_JS', false),
/*
|--------------------------------------------------------------------------
| AutoClose Timer
|--------------------------------------------------------------------------
|
| This is for the all Modal windows.
| For specific modal just use the autoClose() helper method.
|
*/
'timer' => env('SWEET_ALERT_TIMER', 5000),
/*
|--------------------------------------------------------------------------
| Width
|--------------------------------------------------------------------------
|
| Modal window width, including paddings (box-sizing: border-box).
| Can be in px or %.
| The default width is 32rem.
| This is for the all Modal windows.
| for particular modal just use the width() helper method.
*/
'width' => env('SWEET_ALERT_WIDTH', '32rem'),
/*
|--------------------------------------------------------------------------
| Height Auto
|--------------------------------------------------------------------------
| By default, SweetAlert2 sets html's and body's CSS height to auto !important.
| If this behavior isn't compatible with your project's layout,
| set heightAuto to false.
|
*/
'height_auto' => env('SWEET_ALERT_HEIGHT_AUTO', true),
/*
|--------------------------------------------------------------------------
| Padding
|--------------------------------------------------------------------------
|
| Modal window padding.
| Can be in px or %.
| The default padding is 1.25rem.
| This is for the all Modal windows.
| for particular modal just use the padding() helper method.
*/
'padding' => env('SWEET_ALERT_PADDING', '1.25rem'),
/*
|--------------------------------------------------------------------------
| Animation
|--------------------------------------------------------------------------
| Custom animation with [Animate.css](https://daneden.github.io/animate.css/)
| If set to false, modal CSS animation will be use default ones.
| For specific modal just use the animation() helper method.
|
*/
'animation' => [
'enable' => env('SWEET_ALERT_ANIMATION_ENABLE', false),
],
'animatecss' => env('SWEET_ALERT_ANIMATECSS', 'https://cdn.jsdelivr.net/npm/animate.css'),
/*
|--------------------------------------------------------------------------
| ShowConfirmButton
|--------------------------------------------------------------------------
| If set to false, a "Confirm"-button will not be shown.
| It can be useful when you're using custom HTML description.
| This is for the all Modal windows.
| For specific modal just use the showConfirmButton() helper method.
|
*/
'show_confirm_button' => env('SWEET_ALERT_CONFIRM_BUTTON', true),
/*
|--------------------------------------------------------------------------
| ShowCloseButton
|--------------------------------------------------------------------------
| If set to true, a "Close"-button will be shown,
| which the user can click on to dismiss the modal.
| This is for the all Modal windows.
| For specific modal just use the showCloseButton() helper method.
|
*/
'show_close_button' => env('SWEET_ALERT_CLOSE_BUTTON', false),
/*
|--------------------------------------------------------------------------
| Toast position
|--------------------------------------------------------------------------
| Modal window or toast position, can be 'top',
| 'top-start', 'top-end', 'center', 'center-start',
| 'center-end', 'bottom', 'bottom-start', or 'bottom-end'.
| For specific modal just use the position() helper method.
|
*/
'toast_position' => env('SWEET_ALERT_TOAST_POSITION', 'top-end'),
/*
|--------------------------------------------------------------------------
| Middleware
|--------------------------------------------------------------------------
| Modal window or toast, config for the Middleware
|
*/
'middleware' => [
'autoClose' => env('SWEET_ALERT_MIDDLEWARE_AUTO_CLOSE', false),
'toast_position' => env('SWEET_ALERT_MIDDLEWARE_TOAST_POSITION', 'top-end'),
'toast_close_button' => env('SWEET_ALERT_MIDDLEWARE_TOAST_CLOSE_BUTTON', true),
'timer' => env('SWEET_ALERT_MIDDLEWARE_ALERT_CLOSE_TIME', 6000),
'auto_display_error_messages' => env('SWEET_ALERT_AUTO_DISPLAY_ERROR_MESSAGES', false),
],
/*
|--------------------------------------------------------------------------
| Custom Class
|--------------------------------------------------------------------------
| A custom CSS class for the modal:
|
*/
'customClass' => [
'container' => env('SWEET_ALERT_CONTAINER_CLASS'),
'popup' => env('SWEET_ALERT_POPUP_CLASS'),
'header' => env('SWEET_ALERT_HEADER_CLASS'),
'title' => env('SWEET_ALERT_TITLE_CLASS'),
'closeButton' => env('SWEET_ALERT_CLOSE_BUTTON_CLASS'),
'icon' => env('SWEET_ALERT_ICON_CLASS'),
'image' => env('SWEET_ALERT_IMAGE_CLASS'),
'content' => env('SWEET_ALERT_CONTENT_CLASS'),
'input' => env('SWEET_ALERT_INPUT_CLASS'),
'actions' => env('SWEET_ALERT_ACTIONS_CLASS'),
'confirmButton' => env('SWEET_ALERT_CONFIRM_BUTTON_CLASS'),
'cancelButton' => env('SWEET_ALERT_CANCEL_BUTTON_CLASS'),
'footer' => env('SWEET_ALERT_FOOTER_CLASS'),
],
];

23
package-lock.json generated
View File

@@ -9411,20 +9411,10 @@
"vue-style-loader": "^4.1.0" "vue-style-loader": "^4.1.0"
} }
}, },
"vue-meta": { "vue-localstorage": {
"version": "2.4.0", "version": "0.6.2",
"resolved": "https://registry.npmjs.org/vue-meta/-/vue-meta-2.4.0.tgz", "resolved": "https://registry.npmjs.org/vue-localstorage/-/vue-localstorage-0.6.2.tgz",
"integrity": "sha512-XEeZUmlVeODclAjCNpWDnjgw+t3WA6gdzs6ENoIAgwO1J1d5p1tezDhtteLUFwcaQaTtayRrsx7GL6oXp/m2Jw==", "integrity": "sha512-29YQVVkIdoS6BZBCJAyu9d0OR0eKSm5gk5OjsLssV1+NM4zJnf9cxhN1AVeXkUHJLqOonECweuaR8PZ2x307dw=="
"requires": {
"deepmerge": "^4.2.2"
},
"dependencies": {
"deepmerge": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz",
"integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg=="
}
}
}, },
"vue-moment": { "vue-moment": {
"version": "4.1.0", "version": "4.1.0",
@@ -9434,11 +9424,6 @@
"moment": "^2.19.2" "moment": "^2.19.2"
} }
}, },
"vue-router": {
"version": "3.4.2",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.4.2.tgz",
"integrity": "sha512-n3Ok70hW0EpcJF4lcWIwSHAQbFTnIOLl/fhO8+oTs4jHNtBNsovcVvPZeTOyKEd8C3xF1Crft2ASuOiVT5K1mw=="
},
"vue-style-loader": { "vue-style-loader": {
"version": "4.1.2", "version": "4.1.2",
"resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.2.tgz", "resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.2.tgz",

87447
public/css/app.css vendored

File diff suppressed because one or more lines are too long

38458
public/js/app.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
resources/js/app.js vendored
View File

@@ -1,6 +1,7 @@
require('./bootstrap'); require('./bootstrap');
import Vue from 'vue'; import Vue from 'vue';
import TodaysPick from "./components/TodaysPick"; import TodaysPick from "./components/TodaysPick";
import DiscoverTopics from "./components/DiscoverTopics"; import DiscoverTopics from "./components/DiscoverTopics";
import RecentStories from "./components/RecentStories"; import RecentStories from "./components/RecentStories";

View File

@@ -29,13 +29,35 @@
<img src="{{$article->source->logo}}" class="h-10 w-10 rounded-full mr-2 object-cover" /> <img src="{{$article->source->logo}}" class="h-10 w-10 rounded-full mr-2 object-cover" />
<div> <div>
<p class="font-semibold text-gray-200 text-md MvTyper">{{$article->source->name}}</p> <p class="font-semibold text-gray-200 text-md MvTyper">{{$article->source->name}}</p>
<p class="font-semibold text-gray-400 text-xs MvTyper" style="direction: rtl;">{{$article->published_date->locale('dv')->isoFormat('Do MMMM YYYY | dddd | h:mm')}}</p> <p class="font-semibold text-gray-400 text-xs MvTyper" style="direction: rtl;">
{{$article->published_date->locale('dv')->isoFormat('Do MMMM YYYY | dddd | h:mm')}}</p>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="px-4 lg:px-0 mt-12 text-gray-700 max-w-screen-md mx-auto text-lg leading-relaxed"> <div class="px-4 lg:px-0 mt-5 text-gray-700 max-w-screen-md mx-auto text-lg leading-relaxed">
<div class="flex justify-end mb-5 border-b">
<form action="{{route('mylist.store', $article->id)}}" method="POST">
@csrf
<button type="submit"
class="flex items-center justify-center mb-2 shadow p-1 rounded hover:shadow-lg cursor-pointer">
<p class="text-gray-700 text-sm MvTyper text-right mr-2">
ރައްކާކުރޭ
</p>
<svg class="h-5 w-5 text-gray-800" fill="currentcolor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
<g data-name="Froppy disk">
<path
d="M61.707 10.293l-8-8A1 1 0 0053 2H7a5.006 5.006 0 00-5 5v50a5.006 5.006 0 005 5h50a5.006 5.006 0 005-5V11a1 1 0 00-.293-.707zM48 4v16a1 1 0 01-1 1H17a1 1 0 01-1-1V4zM10 60V35a3 3 0 013-3h38a3 3 0 013 3v25zm50-3a3 3 0 01-3 3h-1V35a5.006 5.006 0 00-5-5H13a5.006 5.006 0 00-5 5v25H7a3 3 0 01-3-3V7a3 3 0 013-3h7v16a3 3 0 003 3h30a3 3 0 003-3V4h2.586L60 11.414z" />
<path
d="M39 19h6a1 1 0 001-1V7a1 1 0 00-1-1h-6a1 1 0 00-1 1v11a1 1 0 001 1zm1-11h4v9h-4zM47 45H17a1 1 0 000 2h30a1 1 0 000-2zM47 39H17a1 1 0 000 2h30a1 1 0 000-2zM47 51H17a1 1 0 000 2h30a1 1 0 000-2z" />
</g>
</svg>
</button>
</form>
</div>
@foreach ($article->body as $block) @foreach ($article->body as $block)
<p class="MvTyper text-right" style="direction:rtl;"> <p class="MvTyper text-right" style="direction:rtl;">
{{$block}} {{$block}}

View File

@@ -18,6 +18,7 @@
@include('partials.header') @include('partials.header')
<main class="mt-12"> <main class="mt-12">
@yield('content') @yield('content')
</main> </main>
@@ -26,6 +27,7 @@
</div> </div>
@include('sweetalert::alert')
<script src="/js/app.js"></script> <script src="/js/app.js"></script>
</body> </body>

View File

@@ -0,0 +1,71 @@
@extends('layouts.app')
@section('content')
<div class="mb-10">
<div>
<h3
class="text-gray-800 font-bold text-3xl text-right mt-3 mb-2 mr-3 MvAamu"
>
ރައްކާ ކުރެވިފައިާ ލިޔުންތައް
</h3>
</div>
<div class="flex justify-end">
<!-- post cards -->
<div class="w-full lg:w-2/3">
@foreach($articles as $article)
<div>
<a
href="{{route('articles.show', $article->id)}}"
class="block w-full flex mb-10 shadow rounded-lg"
>
<div
class="bg-white rounded px-4 flex flex-col flex-grow justify-between leading-normal"
>
<div>
<div
class="mt-5 text-gray-700 font-semibold text-1xl mb-2 text-right MvTyper hover:underline"
style="direction:rtl;"
>
{{$article->title}}
</div>
<div
class="flex items-center justify-end mt-3 mb-3"
>
<p
class="font-semibold text-gray-700 text-sm capitalize MvTyper py-4"
>
{{$article->source->name}}
</p>
<p class="text-gray-600 text-xs ml-1 MvTyper" style="direction: rtl;">
{{$article->published_date->locale('dv')->isoFormat('Do MMMM YYYY')}}
&mdash;
</p>
</div>
<p
class="text-gray-700 text-base text-right MvTyper"
style="direction:rtl;"
>
{{$article->body[0]}}
</p>
</div>
</div>
<div
class="h-48 w-48 flex-none bg-cover text-center overflow-hidden rounded object-right dark-img"
style="background-image: url({{$article->featured_image}}); "
></div>
</a>
</div>
@endforeach
</div>
</div>
</div>
@endsection

View File

@@ -13,7 +13,7 @@
<a class="px-4 py-2 mt-2 text-sm font-semibold bg-transparent rounded-lg dark-mode:bg-transparent dark-mode:hover:bg-gray-600 dark-mode:focus:bg-gray-600 dark-mode:focus:text-white dark-mode:hover:text-white dark-mode:text-gray-200 md:mt-0 md:ml-4 hover:text-gray-900 focus:text-gray-900 hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline MvAamu" <a class="px-4 py-2 mt-2 text-sm font-semibold bg-transparent rounded-lg dark-mode:bg-transparent dark-mode:hover:bg-gray-600 dark-mode:focus:bg-gray-600 dark-mode:focus:text-white dark-mode:hover:text-white dark-mode:text-gray-200 md:mt-0 md:ml-4 hover:text-gray-900 focus:text-gray-900 hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline MvAamu"
href="#">ވާހަކަ</a> href="#">ވާހަކަ</a>
<a class="px-4 py-2 mt-2 text-sm font-semibold bg-transparent rounded-lg dark-mode:bg-transparent dark-mode:hover:bg-gray-600 dark-mode:focus:bg-gray-600 dark-mode:focus:text-white dark-mode:hover:text-white dark-mode:text-gray-200 md:mt-0 md:ml-4 hover:text-gray-900 focus:text-gray-900 hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline MvAamu" <a class="px-4 py-2 mt-2 text-sm font-semibold bg-transparent rounded-lg dark-mode:bg-transparent dark-mode:hover:bg-gray-600 dark-mode:focus:bg-gray-600 dark-mode:focus:text-white dark-mode:hover:text-white dark-mode:text-gray-200 md:mt-0 md:ml-4 hover:text-gray-900 focus:text-gray-900 hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline MvAamu"
href="#">އަހަރެންގެ ލިޔުންތަށް</a> href="/mylist">ރައްކާކުރެވިފައިވާ</a>
</nav> </nav>

View File

@@ -0,0 +1,14 @@
@if (config('sweetalert.alwaysLoadJS') === true && config('sweetalert.neverLoadJS') === false )
<script src="{{ $cdn ?? asset('vendor/sweetalert/sweetalert.all.js') }}"></script>
@endif
@if (Session::has('alert.config'))
@if(config('sweetalert.animation.enable'))
<link rel="stylesheet" href="{{ config('sweetalert.animatecss') }}">
@endif
@if (config('sweetalert.alwaysLoadJS') === false && config('sweetalert.neverLoadJS') === false)
<script src="{{ $cdn ?? asset('vendor/sweetalert/sweetalert.all.js') }}"></script>
@endif
<script>
Swal.fire({!! Session::pull('alert.config') !!});
</script>
@endif

View File

@@ -5,6 +5,7 @@ use Illuminate\Support\Facades\Route;
use App\Http\Controllers\API\ArticlesAPIController; use App\Http\Controllers\API\ArticlesAPIController;
use App\Http\Controllers\API\SourcesAPIController; use App\Http\Controllers\API\SourcesAPIController;
use App\Http\Controllers\API\TopicsAPIController; use App\Http\Controllers\API\TopicsAPIController;
use App\Http\Controllers\API\MyListAPIController;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@@ -27,3 +28,4 @@ Route::get('sources', [SourcesAPIController::class, 'index'])->name('api.sources
Route::get('source/{source:slug}',[SourcesAPIController::class, 'show'])->name('api.sources.show'); Route::get('source/{source:slug}',[SourcesAPIController::class, 'show'])->name('api.sources.show');
Route::get('article/{article:id}', [ArticlesAPIController::class, 'show'])->name('api.article.show'); Route::get('article/{article:id}', [ArticlesAPIController::class, 'show'])->name('api.article.show');

View File

@@ -6,6 +6,7 @@ use App\Article;
use App\Http\Controllers\ArticlesController; use App\Http\Controllers\ArticlesController;
use App\Http\Controllers\TopicsController; use App\Http\Controllers\TopicsController;
use App\Http\Controllers\SourcesController; use App\Http\Controllers\SourcesController;
use App\Http\Controllers\MylistController;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@@ -26,6 +27,10 @@ Route::get('/article/{article:id}', [ArticlesController::class,'show'])->name('a
Route::get('/topic/{topic:slug}', [TopicsController::class,'show'])->name('topics.show'); Route::get('/topic/{topic:slug}', [TopicsController::class,'show'])->name('topics.show');
Route::get('/source/{source:slug}', [SourcesController::class,'show'])->name('sources.show'); Route::get('/source/{source:slug}', [SourcesController::class,'show'])->name('sources.show');
Route::get('/mylist', [MylistController::class, 'index'])->name('mylist.index');
Route::post('/mylist/{article:id}', [MylistController::class, 'store'])->name('mylist.store');
Route::get('/ogimage', function(Request $request) { Route::get('/ogimage', function(Request $request) {
$article = Article::findOrFail($request->query('id')); $article = Article::findOrFail($request->query('id'));