pachristos liked a comment+100 XP
1w ago
Here is the code up to this lecture using the composition API with the script setup option.
<template>
<div class="flex w-screen h-screen text-gray-700">
<div class="flex flex-col flex-shrink-0 w-64 border-r border-gray-300 bg-gray-100">
<!-- Sidebar -->
</div>
<div class="flex flex-col flex-grow">
<!-- Main Content -->
<div class="flex flex-col flex-grow overflow-auto">
<editor-content :editor="editor" />
</div>
</div>
</div>
</template>
<script setup>
import { useEditor, EditorContent } from '@tiptap/vue-3'
import StarterKit from '@tiptap/starter-kit'
const editor = useEditor({
content: 'Some Content',
extensions: [
StarterKit,
],
editorProps: {
attributes: {
class: "prose my-6 mx-auto focus:outline-none"
}
}
})
const getDatabase = async () => {
return new Promise((resolve, reject) => {
let db = window.indexedDB.open('notes');
db.onerror = e => {
reject('Error opening the database.')
}
db.onsuccess = e => {
console.log('db.onsuccess', e)
resolve(e.target.result);
}
db.onupgradeneeded = e => {
console.log('db.onupgraded', e)
e.target.result.createObjectStore('notes')
}
});
}
getDatabase();
</script>
<style></style>
pachristos liked a comment+100 XP
2w ago
<?php
namespace App\Console\Commands;
class_alias('App\Models\User', 'User');
use Illuminate\Support\Facades\Artisan;
Artisan::command('abracadabra', function () {
$user = new User();
dump(
$user->getRememberTokenName()
);
});
this is not work, I tried with Laravel 11
when I Run it, I got this errors:
Class "App\Console\Commands\User" not found
at app\Console\Commands\abracadabra.php:11
7▕ // use App\Models\User;
8▕ use Illuminate\Support\Facades\Artisan;
9▕
10▕ Artisan::command('abracadabra', function () {
➜ 11▕ $user = new User();
12▕
13▕ dump(
14▕ $user->getRememberTokenName()
15▕ );
1 vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:36
Illuminate\Foundation\Console\ClosureCommand::App\Console\Commands\{closure}()
2 vendor\laravel\framework\src\Illuminate\Container\Util.php:43
Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
pachristos wrote a comment+100 XP
1mo ago
Regarding removing the bulk delete action for users accessing the app panel, we can define a deleteAny function in the BookPolicy and set it accordingly.
app/Policies/BookPolicy.php:
public function deleteAny(User $user): bool
{
return $this->isAdmin($user);
}
pachristos wrote a comment+100 XP
3mos ago
@Yong Comquas, You dont have this information out of the box, It is stored on the database. Check the code: https://github.com/laracasts/Debugging-Real-World-Production-Nightmares/blob/episode_07/database/migrations/0001_01_01_000000_create_users_table.php
pachristos wrote a comment+100 XP
4mos ago
So, the configuration of Laravel Boost is in .gitignore, but should we commit our configuration in the .ai/ folder to Git or not?
pachristos wrote a comment+100 XP
4mos ago
@amitgupta Actually, I'm using docker and I managed quite easily to make boost work with my editor. Just change the mcp.json to the actual command that the agent should use. In my case, I changed it from:
{
"mcpServers": {
"laravel-boost": {
"command": "php",
"args": [
"artisan",
"boost:mcp"
]
}
}
}
to:
{
"mcpServers": {
"laravel-boost": {
"command": "docker",
"args": [
"compose",
"-f",
"/PATH/TO/docker-compose.yml", // <- Change this to the actual full path
"exec",
"-i",
"-T",
"APPLICATION_NAME", // <- Change this to the actual name defined in the docker-compose.yml
"php",
"artisan",
"boost:mcp"
]
}
}
}
And for laravel Sail something like this may work also:
{
"mcpServers": {
"laravel-boost": {
"command": "./vendor/bin/sail",
"args": ["php", "artisan", "boost:mcp"]
}
}
}
pachristos liked a comment+100 XP
4mos ago
Well said Jeremy!
I apologize for the link, but when I saw the title... couldn't help myself but share this. Hope it makes you smile! https://clawsong.com/t/WX0OGPBced/works-on-my-machine
Don't know what to tell you friend, works on my machine 😅
pachristos wrote a comment+100 XP
4mos ago
For pest arch testers add this immediately:
arch()->expect('env')
->not->toBeUsed();
:P
pachristos wrote a comment+100 XP
5mos ago