artisticre

artisticre

Member Since 2 Years Ago

Experience Points
8,510
Total
Experience

1,490 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
20
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 2
8,510 XP
Sep
17
2 days ago
Activity icon

Awarded Best Reply on Displaying Wrong

I do. I figured it out though. {{ Session::get('cart')->totalQuantity }} I removed the spaces like this {{Session::get('cart')->totalQuantity}} and it works.

Activity icon

Replied to Displaying Wrong

I do. I figured it out though. {{ Session::get('cart')->totalQuantity }} I removed the spaces like this {{Session::get('cart')->totalQuantity}} and it works.

Activity icon

Started a new Conversation Displaying Wrong

I have this simple code that doesn't seem to work. It is just displaying {‌{ Session::get('cart')->totalQuantity }} instead of the number. What am I doing wrong?

@if(Session::has('cart'))
 
									<span class="cart-with-numbers">
													   {‌{ Session::get('cart')->totalQuantity }}
									 </span>
									 
							   @endif
Sep
11
1 week ago
Activity icon

Started a new Conversation CategoriesTableSeeder Error

Not sure why I am getting this error.

Error

Call to undefined function Database\Seeders\factory()

  at C:\wamp64\www\haylee\database\seeders\CategoriesTableSeeder.php:24
     20▕             'parent_id'     =>  null,
     21▕             'menu'          =>  0,
     22▕         ]);
     23▕
  ➜  24▕         factory(App\Models\Category::class, 5)->make();
     25▕     }
     26▕ }

  1   C:\wamp64\www\haylee\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:37
      Database\Seeders\CategoriesTableSeeder::run()

  2   C:\wamp64\www\haylee\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:37
      call_user_func_array([])

Seeder

<?php

namespace Database\Seeders;
use App\Models\Category;
use Faker\Factory as Faker;
use Illuminate\Database\Seeder;

class CategoriesTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        Category::create([
            'name'          =>  'Root',
            'description'   =>  'This is the root category, don\'t delete this one',
            'parent_id'     =>  null,
            'menu'          =>  0,
        ]);

        factory(App\Models\Category::class, 5)->make();
    }
}
Sep
10
1 week ago
Activity icon

Started a new Conversation Target Class [Admin\LoginController] Does Not Exist

Can't find my error. Help!

routes

<?php

use Illuminate\Support\Facades\Route;

Route::group(['prefix'  =>  'admin'], function () {

Route::get('login', 'Admin\[email protected]')->name('admin.login');
Route::post('login', 'Admin\[email protected]')->name('admin.login.post');
Route::get('logout', 'Admin\[email protected]')->name('admin.logout');

Route::get('/', function () {
    return view('admin.dashboard.index');
});

});

LoginController

<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;

class LoginController extends Controller
{
    use AuthenticatesUsers;

    /**
     * Where to redirect admins after login.
     *
     * @var string
     */
    protected $redirectTo = '/admin';

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest:admin')->except('logout');
    }

    /**
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function showLoginForm()
    {
        return view('admin.auth.login');
    }
}
Sep
02
2 weeks ago
Activity icon

Replied to PDOExcetion('Could Not Find Driver')

I did. still the same error. I do not see extension=php_pdo_mysql.dll in my php.ini. How do I get it there?

Activity icon

Replied to PDOExcetion('Could Not Find Driver')

the error I am getting now after dbal is

Doctrine\DBAL\Driver\PDOException::("could not find driver")

Activity icon

Replied to PDOExcetion('Could Not Find Driver')

I see extension=pdo_mysql not commented out but nothing about the .dll

Activity icon

Replied to PDOExcetion('Could Not Find Driver')

Thanks I did that. Nothing worked

Activity icon

Started a new Conversation PDOExcetion('Could Not Find Driver')

I have a fresh install of composer, wamp64, and laravel 7. Trying to migrate my tables and I get the PDO Exception error. Someone said it could be a PHP conflict but I have no idea how to fix it.

php -v

PHP 7.4.9 (cli) (built: Aug 4 2020 11:51:50) ( NTS Visual C++ 2017 x64)
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
Wamp64 PHP version used is 7.4.9

I am running on Windows 10

Aug
27
3 weeks ago
Activity icon

Awarded Best Reply on Buefy Checkbox Not Showing

I had my navbar include inside That was the cause

Activity icon

Replied to Buefy Checkbox Not Showing

I had my navbar include inside That was the cause

Activity icon

Started a new Conversation Buefy Checkbox Not Showing

Not sure what I am doing wrong. Can anyone spot something?

App.js

require('./bootstrap')
window.Vue = require('vue')
import Buefy from 'buefy'
Vue.use(Buefy)

//Must have to bind this to work with VUE js
const app = new Vue({
 el: '#app'
});

layouts.app

  <!-- Scripts -->
    <script src="{{ asset('js/app.js') }}" defer></script>
    @yield('scripts')
</body>
</html>

view

<div class="field">
                    <b-checkbox :value="true"
                    type="is-info">
                        remember
                    </b-checkbox>
                </div>
Aug
25
3 weeks ago
Activity icon

Awarded Best Reply on Call To A Member Function IsValid() On Null

Figured it out. Typo in the validation

            'email' => 'required|email:max:255',

should be

            'email' => 'required|email|max:255',
Activity icon

Replied to Call To A Member Function IsValid() On Null

Figured it out. Typo in the validation

            'email' => 'required|email:max:255',

should be

            'email' => 'required|email|max:255',
Activity icon

Started a new Conversation Call To A Member Function IsValid() On Null

I know its on the validation because if I take the validation out, it posts a comment. Not sure what to fix.

create function

public function store(Request $request,$post_id)
    {
        

        $this->validate($request, array(
            'name' => 'required|max:255',
            'email' => 'required|email:max:255',
            'comment' => 'required|min:5|max:2000'
           
        ));

        $post = Post::find($post_id);
        $comment = new Comment();
        $comment->name = $request->name;
        $comment->email = $request->email;
        $comment->comment = $request->comment;
        $comment->approved = true;
        $comment->post()->associate($post);
        $comment->save();
        Session::flash('success','Comment was added!');
        return redirect()->route('blog.single',[$post->slug]);
    }

migration

public function up()
    {
        Schema::create('comments', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->string('email');
            $table->text('comment');
            $table->boolean('approved');
            $table->integer('post_id')->unsigned();
            $table->timestamps();
        });

        Schema::table('comments', function($table) {
        $table->foreign('post_id')->references('id')->on('posts')->onDelete('cascade');

    });
Aug
19
1 month ago
Activity icon

Awarded Best Reply on Select2

Here is the error but I thought we could add scripts just on single views if we don't want to load it throughout the project

Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <script>, as they will not be parsed.

45 |          </div>
46 |          </main>
47 |  <section class="footer">test</section>
   |                                         
48 |  <script src="http://localhost:8000/js/select2.min.js"></script>
   |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
49 |  <script type="text/javascript">
   |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50 |    $(document).ready(function() {
   |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
51 |      $('.select2-multi').select2();
   |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
52 |  });
   |  ^^^
53 |   </script>
   |  ^^^^^^^^^^
54 |  
   |  
55 |  
   |  
56 |  </div>
Activity icon

Replied to Select2

Here is the error but I thought we could add scripts just on single views if we don't want to load it throughout the project

Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <script>, as they will not be parsed.

45 |          </div>
46 |          </main>
47 |  <section class="footer">test</section>
   |                                         
48 |  <script src="http://localhost:8000/js/select2.min.js"></script>
   |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
49 |  <script type="text/javascript">
   |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50 |    $(document).ready(function() {
   |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
51 |      $('.select2-multi').select2();
   |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
52 |  });
   |  ^^^
53 |   </script>
   |  ^^^^^^^^^^
54 |  
   |  
55 |  
   |  
56 |  </div>
Activity icon

Started a new Conversation Select2

Not sure if this is a Laravel or Javascript question but here goes. I am trying to use a script called select2. I just want to add it to a particular blade view and not throughout my entire project. In my template I have setup sections @yield('stylesheets') in the head and @yield('scripts') just below the body tag. Its like its not connecting to either script. Is there something I am missing?

In my view I have

@section('stylesheets')
{!! Html::style('css/select2.min.css') !!}
@endsection

This is at the bottm.

@section('scripts')
{{Html::script('js/select2.min.js')}}
<script type="text/javascript">
  $(document).ready(function() {
    $('.select2-multi').select2();
});
 </script>
@endsection

Oh the form I am using

 <select name="tags" class="select2-multi form-control" multiple="multiple">
          @foreach($tags as $tag)
            <option value="{{$tag->id}}">{{$tag->name}}</option>
            @endforeach
        </select> 
Aug
18
1 month ago
Activity icon

Started a new Conversation Relationships And Displaying Data.

I have two models Users, Posts. Either I am not doing the relationships correctly or there is something I am missing but it is not displaying anything. No error, just empty field on my view

User Model

  public function posts()
   {
       return $this->hasMany('App\Post');
   }

Post Model

public function users(){
        return $this->belongsTo('App\User');
    }

Controller

 public function getSingle($slug)
    {
       $post = Post::where('slug', '=', $slug)->first();
       return view('blog.single')->with('post', $post);

    }

How I Display The Data

{{$post->user['name']}}
Aug
17
1 month ago
Activity icon

Replied to Password Reset

This is my ResetPasswordController and it still goes to /home

<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\ResetsPasswords;

class ResetPasswordController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Password Reset Controller
    |--------------------------------------------------------------------------
    |
    | This controller is responsible for handling password reset requests
    | and uses a simple trait to include this behavior. You're free to
    | explore this trait and override any methods you wish to tweak.
    |
    */

    use ResetsPasswords;

    /**
     * Where to redirect users after resetting their password.
     *
     * @var string
     */
protected $redirectTo = '/login';


}

Activity icon

Started a new Conversation Password Reset

Quick Question:

I have the password reset working but when it resets the password, it redirects to /home when I want it to redirect to /login. What file controls this action?

Activity icon

Started a new Conversation DB Question

I have two tables Users and Posts. I am trying to understand relationships. I have already created these tables and everything is working. Now I want to create a controller that lists the posts based on the user_id. Would I put a column in the Posts table called user_id to be able to query the db or is there a better way?

User Model

 public function posts() {
        return $this->belongsToMany('App\Post');
    }

Post Model

public function users(){
        return $this->belongsToMany('App\User');
    }

Users Table

 public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->string('email')->unique();
            $table->timestamp('email_verified_at')->nullable();
            $table->string('password');
            $table->rememberToken();
            $table->timestamps();
        });
    }

Posts Table

public function up()
    {
        Schema::create('posts', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title');
            $table->text('body');
            $table->timestamps();
        });
    }
Aug
13
1 month ago
Activity icon

Replied to Why Am I Getting This Error?

so how do I do a seperate template for one page?

Activity icon

Started a new Conversation Why Am I Getting This Error?

I know it is probably something pretty simple but for the life of me I cannot figure out why I get this error:

The requested resource /blog was not found on this server.

Route

Route::resource('/blog','BlogController');

BlogController

public function index()
    {
        return view('blog.index');
    }

Blog.index

@extends('layouts.bloglayout')

@section('content')
TEST BLOG PAGE
@endsection

bloglayout

<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title>{{ config('app.name', 'Laravel') }}</title>

    <!-- Scripts -->
    <script src="{{ asset('blog/js/app.js') }}" defer></script>

      <!-- Styles -->
  <!-- Custom styles for this template -->
  <link href="blog/css/clean-blog.min.css" rel="stylesheet"></head>
<body>
    @include('inc.navbar')
   @include('inc.jumbotron') 
    <div id="app">
        

        <main class="py-4">
            <div class="container">
            @include('inc.alerts')
            
            @yield('content')
        </div>
        </main>
    </div>
    <script src="blog/js/clean-blog.min.js"></script>
</body>
</html>
Aug
03
1 month ago
Activity icon

Started a new Conversation Vue Script Not Working

I have this code when on my individual page, does not work. But if I put it in app.js, it works but there is an error because it cant find $user. How do I get it to work on my blade view?

@section('scripts')
  <script>

    var app = new Vue({
      el: '#app',
      data: {
        rolesSelected: {!! $user->roles->pluck('id') !!}
      }
    });

  </script>
@endsection

my layout where I yield scripts

<div class="management-area" id="app">
      
            @yield('content')
                  </div>
                  <script src="{{ asset('js/app.js') }}" defer></script>
    @yield('scripts') 
</body>
</html>
Jun
26
2 months ago
Activity icon

Replied to String Back To Checked Checkbox

@snapey

Here is my form collection

<div class="pretty p-default">
        <input type="checkbox" name="clergy[]" value="Spiritual Director" />
        <div class="state p-info">
            <label class="lead text-primary">Spiritual Director</label>
        </div>
    </div>

    <!-- warning -->
    <div class="pretty p-default">
        <input type="checkbox" name="clergy[]" value="Lay Team" />
        <div class="state p-warning">
            <label class="lead text-primary">Lay Team</label>
        </div>
    </div>

    <!-- danger -->
    <div class="pretty p-default">
        <input type="checkbox" name="clergy[]" value="Wherever Needed" />
        <div class="state p-danger">
            <label class="lead text-primary">Wherever Needed</label>
        </div>
    </div>

And my store controller

        'clergy' => ['required'],
       $clergyString = implode(",", $request->get('clergy'));
         $team->clergy =  $clergyString;
Jun
25
2 months ago
Activity icon

Replied to String Back To Checked Checkbox

@snapey I have it working if I have a list of them such as $clergy = 'Spiritual Director,Wherever Needed' but I want to change this to the following and have it pulled from the database. Right now the code below works but nothing is checked. Its pulling the data but the foreach loop isn't looking at the $userroles for some reason so nothing is checked.

When I dd I get $userroles

Illuminate\Support\Collection {#1311 ▼
  #items: array:3 [▼
    0 => "[{"clergy":"Spiritual Director"
    1 => "Wherever Needed""
    2 => ""id":6}]"
  ]
}
$clergy = DB::table('users')
                ->join('teamapp', 'teamapp.user_id', '=' ,'users.id')
                ->select(
                    'clergy',
                    'teamapp.id'
                    )
                    ->where('teamapp.id', '=', $id)
                    ->get();
Activity icon

Replied to String Back To Checked Checkbox

I got this working if I use

$clergy = 'Table Leader,Head Palanca,Mime';

but I want to do this

$clergy = DB::table('users')
                ->join('teamapp', 'teamapp.user_id', '=' ,'users.id')
                ->select(
                    'clergy',
                    'teamapp.id'
                    )
                    ->where('teamapp.id', '=', $id)
                    ->get();

If I do dd($userroles); I get

Illuminate\Support\Collection {#1311 ▼
  #items: array:3 [▼
    0 => "[{"clergy":"Spiritual Director"
    1 => "Wherever Needed""
    2 => ""id":6}]"
  ]
}

So I know its pulling the correct data, but on my loop, nothing is getting checked. If I change $clergy back to the list, I get them checked.

@foreach($allroles as $role)
  <label for="check-{{ $loop->index }}">{{ $role }}
      <input type='checkbox' value="{{ $role }}" id="check-{{ $loop->index }}"
	  @if($userroles->contains($role)) checked @endif
      />
  </label>
@endforeach 

Jun
24
2 months ago
Activity icon

Replied to String Back To Checked Checkbox

I got this working. Thank you so much. But how do I make this part dynamic?

                $clergy = 'Spiritual Director,Wherever Needed';

I tried this and when I dd($clergy) it shows in the array but does not check the boxes.

$clergy = DB::table('users')
                ->join('teamapp', 'teamapp.user_id', '=' ,'users.id')
                ->select(
                    'clergy',
                    'teamapp.id'
                    )
                    ->where('teamapp.id', '=', $id)
                    ->get();
                       
                $userroles = collect(explode(',',$clergy));

                return view('teamapplication.show')->with('team', $team)->with('userroles', $userroles)->with('allroles', $allroles);

My loop

@foreach($allroles as $role)
<div class="pretty p-icon p-round">
<input disabled type='checkbox' value="{{ $role }}" id="check-{{ $loop->index }}"
	  @if($userroles->contains($role)) checked @endif
      />
      <div class="state p-warning">
      <label for="check-{{ $loop->index }}">{{ $role }}
      
      </label>
    
      </div>
</div>
@endforeach 
Jun
23
2 months ago
Activity icon

Replied to String Back To Checked Checkbox

What do you all think of this? Is this a good way to do this or not? For each of the checkboxes

<input type="checkbox" value="Sacristan" id="teamexperience" name="teamexperience[]"
  @if(in_array("Sacristan", explode(",", $t->teamexperience)))
    {{"checked" }}
@endif />
Activity icon

Replied to String Back To Checked Checkbox

I came up with this but I get an error syntax error, unexpected ','

@foreach($team as $clergy)
     <input type="checkbox" name="clergy[]" value="{{$clergy->id}}" {{($clergy->id, explode(',', $clergy->clergy))  ? 'selected' : ''}}>{{$clergy->clergy}}
   @endforeach
Activity icon

Replied to String Back To Checked Checkbox

They will only be present if they are chosen from the form. This is the list the user can chose from, but the db will only have their choices. I am really lost. Is it possible to show an example?

Activity icon

Replied to String Back To Checked Checkbox

Here are the possible options. They are inputted in the db as comma seperated. I want to pull them out, remove the commas, and have a checked checkbox and label for each option in the array. I have no idea what to do though

Sacristan, Head Spiritual Director, Cook, Palanca, Table Leader, Cook Team Leader, Head Palanca, Rollista, Assistant Head Cook, Assistant Sacristan, Spiritual Director, Head Cook, Mime, Assistant Rector/a, Angel, Musician, Rector/a, Head Angel, Head Musician, Mentor

Activity icon

Replied to String Back To Checked Checkbox

The output is comma separated. I tried the following and I get Undefined index: teamexperience

I think I am close but not sure how to fix this error.

{
            $team= DB::table('users')
            ->join('profile', 'profile.user_id', '=', 'users.id')
            ->leftJoin('teamapp', 'teamapp.user_id', '=' ,'users.id')
            ->select(
                '*'
                )
                ->where('teamapp.id', '=', $id)
                ->get();
                $clergarray = htmlspecialchars(stripslashes($team['teamexperience']));
                $clerg = explode(",", $clergarray);


                return view('teamapplication.show')->with('team', $team)->with('clerg', $clerg);
        }

and in my view

@foreach ($clerg as $key => $cl)
    <input type="checkbox" value="<?php echo "$cl" ;?>"
<?php if (isset($clerg) && in_array("$cl" , $clerg))
{echo 'checked="checked"' ; }?>
/>
<label ><?php echo "$cl" ; ?></label><br />
              @endforeach
Activity icon

Started a new Conversation String Back To Checked Checkbox

I have a checkbox that has 15 options that is writing the checked options as a string in the database. I want to know how to take that string and display it back as checked checkboxes on the show view. The field I am trying to have as checkboxes is teampapp.teamexperience. I don't know where to start...

This is my function to the show page

$team= DB::table('users')
            ->join('profile', 'profile.user_id', '=', 'users.id')
            ->leftJoin('teamapp', 'teamapp.user_id', '=' ,'users.id')
            ->select(
                '*'
                )
                ->where('teamapp.id', '=', $id)
                ->get();
                return view('teamapplication.show', compact('team'));
Jun
22
2 months ago
Activity icon

Started a new Conversation Checkbox Question

I have a checkbox that works like I want to if it is checked but if its not checked I get Undefined index: financialsupport

Checkbox

<input class="financialsupport" type="checkbox" name="financialsupport" value="I Require Financial Support"/>
        'financialsupport' => ['nullable'],
         $team->financialsupport = $data['financialsupport'];

Jun
18
3 months ago
Activity icon

Replied to Delete Modal Not Deleting

ok that makes sense. It does close but does not delete the item. Is there an easier way to do this?

Activity icon

Replied to Delete Modal Not Deleting

Quite honestly I dont know. I was following a tutorial. I took it out but it still does nothing.

Activity icon

Started a new Conversation Delete Modal Not Deleting

When I click the delete button my modal works and gives me the message and another delete button in a form. When I click delete, it does nothing. What am I doing wrong?

Modal Link

 <a href="javascript:;" data-toggle="modal" onclick="deleteData({{$row->id}})" 
data-target="#DeleteModal" class="btn btn-xs btn-danger">Delete</a>

Modal

<div id="DeleteModal" class="modal fade text-danger" role="dialog">
   <div class="modal-dialog ">
     <!-- Modal content-->
     <form action="{{route('registrar.pilgrim.delete', $row->id)}}" id="deleteForm" method="post">
         <div class="modal-content">
             <div class="modal-header bg-danger">
                 <button type="button" class="close" data-dismiss="modal">&times;</button>
                 <h4 class="modal-title text-center">DELETE CONFIRMATION</h4>
             </div>
             <div class="modal-body">
                 {{ csrf_field() }}
                 {{ method_field('DELETE') }}
                 <p class="text-center">Are You Sure Want To Delete ?</p>
             </div>
             <div class="modal-footer">
               
                     <button type="button" class="btn btn-success" data-dismiss="modal">Cancel</button>
                     <button type="submit" name="" class="btn btn-danger" data-dismiss="modal" onclick="formSubmit()">Yes, Delete</button>
              
             </div>
         </div>
     </form>
   </div>
  </div>

Delete Route

Route::get('pilgrim-delete/{id}','[email protected]')->name('registrar.pilgrim.delete');

Delete Controller

public function pilgrimDestroy($id)
    {
       
        
        DB::delete('delete from pilgrimapp where id = ?',[$id]);
        

        return redirect()->route('registrar-dashboard');
    }
Jun
16
3 months ago
Activity icon

Replied to The POST Method Is Not Supported For This Route. Supported Methods: GET, HEAD, PUT, PATCH, DELETE.

I'm not sure what I should put there? What code do you need to see?

Activity icon

Replied to The POST Method Is Not Supported For This Route. Supported Methods: GET, HEAD, PUT, PATCH, DELETE.

Route

Route::resource('/pilgrimapp', 'PilgrimApplication');

RouteList

 PUT|PATCH | pilgrimapp/{pilgrimapp}      | pilgrimapp.update        | App\Http\Controllers\[email protected]
Activity icon

Started a new Conversation The POST Method Is Not Supported For This Route. Supported Methods: GET, HEAD, PUT, PATCH, DELETE.

Why am i getting this error with a resource controller and I am using this?

<form class="" action="{{ route('pilgrimapp.update', $pedit->id) }}" method="POST">
{{ method_field('PUT') }}
                        @csrf
Activity icon

Awarded Best Reply on BarryVDH Something Weird Happening

I took the data out of an input and it works. Not sure why it double up with the input but problem solved I guess

So I went from

<input type="text" disabled value="{{ $p->ifnospouseattend ?? 'N/A' }}">

to

{{ $p->sponsorsupport ?? 'N/A' }} 
Activity icon

Replied to BarryVDH Something Weird Happening

I took the data out of an input and it works. Not sure why it double up with the input but problem solved I guess

So I went from

<input type="text" disabled value="{{ $p->ifnospouseattend ?? 'N/A' }}">

to

{{ $p->sponsorsupport ?? 'N/A' }} 
Jun
13
3 months ago
Activity icon

Replied to BarryVDH Something Weird Happening

Nope. I even closed the foreach and started a new for each after a page break and it still is doubling up the first field on the page. I just don't get it.

Activity icon

Replied to BarryVDH Something Weird Happening

Here is my view and css

<style>

@media print {
      size:A4;
      .download {display:none}
    }
    @page { size:8.5in 11in; margin-left:.10px;margin-top: 1cm;margin-bottom: .5vm;margin-right:.10px; }
   
table {
  width: 100%;
  margin:0 auto;
  border-spacing:0;
  overflow:hidden;
  border:1px solid black;
} 



 tr, td {
  border: 1px solid black;
}
ol {
  list-style:number;
  font-size:1em;
}
li {
  padding-bottom:10px;
}

input[type=text],
input[type=password] {
width:100%;
display: block;
  padding: .3em 1em;
  background-color: #f2f2f2;
  font-size: 1em;
  color: #0275d8;
 
}

input {
    box-sizing: border-box;
    border: 1px solid #bdbdbd;
    margin-bottom:10px;
}
textarea {
	min-height: 10em;
	max-height: 50vh;
	width: 100%;
}


label {
  color:black;
  font-weight:bold;
  font-size:1em;

}


}



</style>

<table style="width:90%;margin:0 auto;padding:0px">
@foreach ($sponsor_print as $key => $p)

	
<tr>
   <td colspan="6" style="margin:0 auto;text-align:center"><img src="images/lclogo.jpg" width="450" height="125"></td>
</tr>

   <tr> 
   <td colspan="6" style="text-align:left;color:black;font-size:1.10em;padding:10px;">
   <h5 class="card-title font-weight-bold text-center pt-3">PLEASE FILL THE APPLICATION OUT COMPLETELY AND COMPLETE ONE APPLICATION PER APPLICANT</H5>
      <p class="lead">Carefully review the sponsor guidelines before sponsoring anyone.  Send the completed application to the registrar.
      Married couples should have the same sponsor(s).  A non-refundable donation of  for each pilgrim sponsored is requested. 
      The goal of the movement is to inspire, challenge and equip local church members for Christian action in their lives, homes, churches,
      and communities.</p>
   </td> 
   </tr>	
   
   <tr>
   <td colspan="6" cellpadding="0" style="text-align:center;font-weight:bold;font-size:1.5em;background-color:#0275d8;color:white;padding:0px;">Sponsor Information</td>
 </tr>
 <tr>
 <td colspan="6"><label>Name: </label><input type="text" value="{{$p->name ?? 'N/A'}}"></td>
 </tr>
 <tr>
 <td colspan="3"><label>Address: </label> <input type="text" value="{{$p->address ?? 'N/A'}}"></td>
 <td colspan="3"><label>Apt #: </label> <input type="text" value="{{$p->apt ?? 'N/A'}}"></td>
 </tr>

 <tr>
 <td colspan="2"><label>City: </label> <input type="text" value="{{$p->city ?? 'N/A'}}"></td>
 <td colspan="2"><label>State: </label> <input type="text" value="{{$p->state ?? 'N/A'}}"></td>
 <td colspan="2"><label>Zipcode: </label> <input type="text" value="{{$p->zipcode ?? 'N/A'}}"></td>
 </tr>

 <tr>
 <td colspan="2"><label>Email: </label> <input type="text" value="{{$p->email ?? 'N/A'}}"></td>
 <td colspan="2"><label>(H) Phone: </label> <input type="text" value="{{$p->homephone ?? 'N/A'}}"></td>
 <td colspan="2"><label>(C) Phone: </label> <input type="text" value="{{$p->cellphone ?? 'N/A'}}"></td>
 </tr>
<tr>
<td colspan="3"><label for="applicantname" class="font-weight-bold col-form-label text-md-left">{{ __('Applicant Name') }}</label>
<input type="text" value="{{ $p->applicantname }}" disabled>
</td>
<td colspan="3">
<label for="besttime" class="font-weight-bold col-form-label text-md-left">{{ __('Best Time To Call') }}</label>
<input type="text" value="{{ $p->besttime }}" disabled>
</td>
</tr>

<tr>
<td colspan="3"><label for="applicantbaptized" class="font-weight-bold col-form-label text-md-left">{{ __('Is this applicant a baptized member
  in regular attendance and/or active in ministries of a Lutheran Church?') }}</label>
<input type="text" value="{{$p->applicantbaptized ? 'Yes' : 'No'}}" disabled>
</td>
<td colspan="3">
<label for="spousediscussed" class="font-weight-bold col-form-label text-md-left">{{ __('If applicable, did you discuss Lutheran Cursillo
  with the applicant\'s spouse?') }}<br /><br /></label>
<input type="text" value="{{$p->spousediscuss ? 'Yes' : 'No'}}" disabled>
  
</td>
</tr>

<tr>
<td colspan="6">
<label for="bothspouseattend" class="font-weight-bold col-form-label text-md-left">{{ __('
  Will both be applying to attend the weekend?') }}</label>
<input type="text" value="{{$p->bothspouseattend ? 'Yes' : 'No'}}" disabled>
</td>
</tr>
<tr>
<td colspan="6">
<label for="ifnospouseattend" class="col-form-label text-md-left font-weight-bold">{{ __('If Answered No, please explain briefly:') }}</label>
<input type="text" disabled value="{{ $p->ifnospouseattend ?? 'N/A' }}">
</td>
</tr>

<tr>
<td colspan="6">
<label for="whygoodcandidate" class="col-form-label text-md-left font-weight-bold">{{ __('Why do you think this person is a good candidate for a Cursillo weekend') }}</label>
   <input type="text" disabled value="{{ $p->whygoodcandidate ?? 'N/A' }}">
</td>
</tr>

<tr>
<td colspan="6">
<label for="applicantattitude" class="col-form-label text-md-left font-weight-bold">{{ __('
   Briefly state the applicant\'s attitude toward Lutheran Cursillo') }}</label>
   <input type="text" disabled value="{{ $p->applicantattitude ?? 'N/A' }}">
</td>
</tr>

<tr>
<td colspan="6">
<label for="leadershipexpectations" class="col-form-label text-md-left font-weight-bold">{{ __('
   With leadership in mind, what do you expect this person to gain from the Cursillo experience?') }}</label>
   <input type="text" disabled value="{{ $p->leadershipexpectations ?? 'N/A' }}">
</td>
</tr>

<tr>
<td colspan="6">
<label for="sponsorsupport" class="col-form-label text-md-left font-weight-bold">{{ __('
   How, specifically, will you support this applicant during his/her fourth day?') }}</label>
   <input type="text" disabled value="{{ $p->sponsorsupport ?? 'N/A' }}">
</td>
</tr>

<tr>
<td colspan="6">
<label for="otherinfo" class="col-form-label text-md-left font-weight-bold">{{ __('
   Other pertinent information about the applicant:') }}</label>
   <input disabled type="text" value="{{ $p->otherinfo ?? 'N/A' }}">

</td>

</tr>


<tr>
 <td colspan="2"><label>Sponsor Signature: </label> <input type="text" value="{{$p->name ?? 'N/A'}}"></td>
 <td colspan="2"><label>Sponsor Email: </label> <input type="text" value="{{$p->email ?? 'N/A'}}"></td>
 <td colspan="2"><label>Date Signed: </label> <input type="text" value="{{$p->datesigned ?? 'N/A'}}"></td>
 </tr>
 @endforeach
</table>
Activity icon

Replied to BarryVDH Something Weird Happening

Should I change to div?

Activity icon

Replied to BarryVDH Something Weird Happening

No I haven't. Here is an example of what I am talking about. If the data printing to this field is"

We are a Southern California based leadership development ministry serving all Lutheran
churches. We are a lay-led movement focused on preparing strong Christian leaders to go back
into their churches and communities and serve. As a self-supporting organization, we operate
independently of any synod, branch or other church body, but adhere to the core values and
teachings of the Lutheran faith.

It displays like this, printing the data 3 times. Only on the first field of the page. It doesn't do it if I print to a view.

We are a Southern California based leadership development ministry serving all Lutheran
churches. We are a lay-led movement focused on preparing strong Christian leaders to go back
into their churches and communities and serve. As a self-supporting organization, we operate
independently of any synod, branch or other church body, but adhere to the core values and
teachings of the Lutheran faith.We are a Southern California based leadership development
ministry serving all Lutheran churches. We are a lay-led movement focused on preparing strong
Christian leaders to go back into their churches and communities and serve. As a self-supporting
organization, we operate independently of any synod, branch or other church body, but adhere to
the core values and teachings of the Lutheran faith.We are a Southern California based
leadership development ministry serving all Lutheran churches. We are a lay-led movement
focused on preparing strong Christian leaders to go back into their churches and communities
and serve. As a self-supporting organization, we operate independently of any synod, branch or
other church body, but adhere to the core values and teachings of the Lutheran faith.
We are a Southern California based leadership development ministry serving all Lutheran
churches. We are a lay-led movement focused on preparing strong Christian leaders to go back
into their churches and communities and serve. As a self-supporting organization, we operate
independently of any synod, branch or other church body, but adhere to the core values and
teachings of the Lutheran faith.We are a Southern California based leadership development
ministry serving all Lutheran churches. We are a lay-led movement focused on preparing strong
Christian leaders to go back into their churches and communities and serve. As a self-supporting
organization, we operate independently of any synod, branch or other church body, but adhere to
the core values and teachings of the Lutheran faith.