Skip to content

Commit 76e6f3c

Browse files
Initialize Project
1 parent 42d0ae0 commit 76e6f3c

File tree

6 files changed

+104
-0
lines changed

6 files changed

+104
-0
lines changed

components/toster-session.blade.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@php
2+
if(!isset($errors)) $errors= new Illuminate\Support\ViewErrorBag;
3+
@endphp
4+
5+
@if (session()->has('success'))
6+
<input type="hidden" id="session_success" value="{{ session()->get('success')}}">
7+
@endif
8+
@if (session()->has('status'))
9+
<input type="hidden" id="session_success" value="{{ session()->get('status')}}">
10+
@endif
11+
@if(session()->has('error'))
12+
<input type="hidden" id="session_error" value="{{ session()->get('error')}}">
13+
@endif
14+
@if(session()->has('warning'))
15+
<input type="hidden" id="session_warning" value="{{ session()->get('warning')}}">
16+
@endif
17+
@if(session()->has('info'))
18+
<input type="hidden" id="session_info" value="{{ session()->get('info')}}">
19+
@endif
20+
@if($errors->any())
21+
<input type="hidden" id="session_error_count" value="{{ count($errors) }}">
22+
@foreach ($errors->all() as $key=>$error)
23+
<input type="hidden" id="session_error{{ $key }}" value="{{ $error }}">
24+
@endforeach
25+
@endif

js/toster-session.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
$(document).ready(function () {
2+
if ($("#session_success").val()) {
3+
toastr.success($("#session_success").val());
4+
}
5+
if ($("#session_error").val()) {
6+
toastr.error($("#session_error").val());
7+
}
8+
if ($("#session_warning").val()) {
9+
toastr.warning($("#session_warning").val());
10+
}
11+
if ($("#session_info").val()) {
12+
toastr.info($("#session_info").val());
13+
}
14+
if ($("#session_error_count").val()) {
15+
for (let index = 0; index < $("#session_error_count").val(); index++) {
16+
toastr.error($("#session_error" + index).val());
17+
}
18+
}
19+
});

plugins/toastr/toastr.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/toastr/toastr.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/toastr/toastr.min.js

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

readme.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
## About <a href="javascript:void();" target="_blank">Laravel Toster Session Flash Message Component</a>
2+
3+
DToster Session Flash Message Components For Laravel Project
4+
5+
## Doc:
6+
7+
<hr/>
8+
9+
- first copy plugins and js folder then paste it on public folder
10+
11+
- Then Link those Js and css file to your layouts/app.blade
12+
13+
- For Css
14+
```
15+
<link rel="stylesheet" href="{{ asset('plugins/toastr.min.css') }}">
16+
```
17+
- For Js
18+
```
19+
<script src="{{asset('plugins/toastr/toastr.min.js')}}"></script>
20+
<script src="{{asset('js/toster-session.js')}}"></script>
21+
22+
```
23+
24+
- then copy components/toster-session.blade.php and paste it on resource/views/components folder.
25+
26+
- For use This Componet use those Line to your layout file
27+
28+
```
29+
{{-- call It for once time --}}
30+
<x-toster-session>
31+
```
32+
33+
```
34+
35+
## <a href="https://iqbalhasan.dev" target="_blank">iqbalhasan.dev</a> Sponsors
36+
37+
We would like to extend our thanks to the following sponsors for funding <a href="https://iqbalhasan.dev" target="_blank">iqbalhasan.dev</a> development. If you are interested in becoming a sponsor, please email us <a href="mailto:info@iqbalhasan.dev">info@iqbalhasan.dev</a>
38+
39+
## Security Vulnerabilities
40+
41+
If you discover a security vulnerability within Laravel, please send an e-mail to <a href="https://iqbalhasan.dev" target="_blank">IQBAL HASAN</a> via [info@iqbalhasan.dev](mailto:info@iqbalhasan.dev). All security vulnerabilities will be promptly addressed.
42+
43+
## License
44+
45+
The iqbalhasan.dev Project is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
46+
47+
```
48+
49+
```
50+
51+
```

0 commit comments

Comments
 (0)